|
@@ -47,9 +47,11 @@
|
|
|
<script type="text/javascript">
|
|
|
let top_left_control = new BMap.ScaleControl({anchor: BMAP_ANCHOR_TOP_LEFT}); // 左上角,添加比例尺
|
|
|
let top_left_navigation = new BMap.NavigationControl(); // 左上角,添加默认缩放平移控件
|
|
|
- let top_right_navigation = new BMap.NavigationControl({anchor: BMAP_ANCHOR_TOP_RIGHT, type: BMAP_NAVIGATION_CONTROL_SMALL}); //右上角,仅包含平移和缩放按钮
|
|
|
- /*缩放控件type有四种类型:
|
|
|
- BMAP_NAVIGATION_CONTROL_SMALL:仅包含平移和缩放按钮;BMAP_NAVIGATION_CONTROL_PAN:仅包含平移按钮;BMAP_NAVIGATION_CONTROL_ZOOM:仅包含缩放按钮*/
|
|
|
+ let top_right_navigation = new BMap.NavigationControl({anchor: BMAP_ANCHOR_TOP_RIGHT, type: BMAP_NAVIGATION_CONTROL_SMALL}); // 右上角,仅包含平移和缩放按钮
|
|
|
+ /*
|
|
|
+ 缩放控件type有四种类型:
|
|
|
+ BMAP_NAVIGATION_CONTROL_SMALL:仅包含平移和缩放按钮;BMAP_NAVIGATION_CONTROL_PAN:仅包含平移按钮;BMAP_NAVIGATION_CONTROL_ZOOM:仅包含缩放按钮
|
|
|
+ */
|
|
|
|
|
|
// 百度地图 API 功能
|
|
|
let map = new BMap.Map("map");
|
|
@@ -58,7 +60,7 @@
|
|
|
// IP 定位
|
|
|
let myCity = new BMap.LocalCity();
|
|
|
myCity.get(getCity);
|
|
|
- map.centerAndZoom(point, 18);
|
|
|
+ map.centerAndZoom(point, 19);
|
|
|
// 添加地图类型控件
|
|
|
map.addControl(new BMap.MapTypeControl({mapTypes: [BMAP_NORMAL_MAP, BMAP_HYBRID_MAP]}));
|
|
|
map.setCurrentCity("郑州"); // 设置地图显示的城市 此项是必须设置的
|
|
@@ -80,7 +82,7 @@
|
|
|
|
|
|
marker.setLabel(label); // 创建标注的文字标签
|
|
|
map.addOverlay(marker); // 将标注添加到地图中
|
|
|
- let circle = new BMap.Circle(point, 100, {fillColor: "gray", strokeWeight: 1, fillOpacity: 0.3, strokeOpacity: 0.3});
|
|
|
+ let circle = new BMap.Circle(point, 80, {fillColor: "gray", strokeWeight: 1, fillOpacity: 0.3, strokeOpacity: 0.3});
|
|
|
map.addOverlay(circle);
|
|
|
|
|
|
function updateLocation(data) {
|