<!DOCTYPE html><html><head>? ? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />? ? <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />? ? <style type="text/css">? ? body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微軟雅黑";}? ? </style>? ? <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=qEZVDmsH6cep8HGgnT0eG6bR6c1IUSsA"></script>? ? <script src="js/jquery.min.js"></script>? ? <title>地圖展示</title></head><body>? ? <div id="allmap"></div></body></html><script type="text/javascript">? ? // 百度地圖API功能? ? var map = new BMap.Map("allmap"); ? ?// 創(chuàng)建Map實例? ? map.setMapStyle({? ? ? ?styleJson:[? ? ? ? ? ? ?{? ? ? ? ? ? ? ? "featureType": "poi",? ? ? ? ? ? ? ? "elementType": "all",? ? ? ? ? ? ? ? "stylers": {? ? ? ? ? ? ? ? ? ? ? ? ? "color": "#ffffff",? ? ? ? ? ? ? ? ? ? ? ? ? "visibility": "off"? ? ? ? ? ? ? ? }? ? ? ? ? ? ? },? ? ? ? ? ? ? {? ? ? ? ? ? ? ? ? ? ? ? "featureType": "road",? ? ? ? ? ? ? ? ? ? ? ? "elementType": "all",? ? ? ? ? ? ? ? ? ? ? ? "stylers": {? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "color": "#ffffff",? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "visibility": "off"? ? ? ? ? ? ? ? ? ? ? ? }? ? ? ? ? ? ? }? ? ? ? ]? ? });? ? map.centerAndZoom("鄭州", 5); ?// 初始化地圖,設(shè)置中心點坐標(biāo)和地圖級別? ? map.addControl(new BMap.MapTypeControl()); ? //添加地圖類型控件? ? map.setCurrentCity("鄭州"); ? ? ? ? ?// 設(shè)置地圖顯示的城市 此項是必須設(shè)置的? ? map.enableScrollWheelZoom(true); ? ? //開啟鼠標(biāo)滾輪縮放? ? //map.disableScrollWheelZoom();//禁止鼠標(biāo)滾輪縮放? ? map.disableDoubleClickZoom(true);//禁止雙擊縮放? ? map.addControl(new BMap.NavigationControl()); ?//添加默認(rèn)縮放平移控件? ? map.addControl(new BMap.OverviewMapControl()); //添加默認(rèn)縮略地圖控件? ? var points = []; ?? ? points.push(new BMap.Point(112.979,28.213));?? ? points.push(new BMap.Point(160.979,28.45));? ? points.push(new BMap.Point(140.979,28.108));? ? var options = {? ? ? ? size: BMAP_POINT_SIZE_NORMAL,? ? ? ? shape: BMAP_POINT_SHAPE_STAR,? ? ? ? color: 'green'? ? }? ? var pointCollection = new BMap.PointCollection(points, options);? ? map.addOverlay(pointCollection); // 添加Overlay? ? var pointss = []; ?? ? pointss.push(new BMap.Point(113.979,23.213));?? ? pointss.push(new BMap.Point(163.979,23.45));? ? pointss.push(new BMap.Point(143.979,23.108));? ? var optionss = {? ? ? ? shape: BMAP_POINT_SHAPE_WATERDROP? ? }? ? var pointCollections = new BMap.PointCollection(pointss, optionss);? ? map.addOverlay(pointCollections); // 添加Overlay</script>
百度地圖高亮效果或者只顯示中國地名怎么實現(xiàn)?急求?。?!
夢魂清風(fēng)
2017-03-08 08:40:39