diff --git a/dist.zip b/dist.zip index c62748c..01f11cb 100644 Binary files a/dist.zip and b/dist.zip differ diff --git a/src/view/guide.vue b/src/view/guide.vue index 08a6279..cd9bd2b 100644 --- a/src/view/guide.vue +++ b/src/view/guide.vue @@ -498,6 +498,7 @@ body { width: 180px; height: 180px; position: relative; + cursor: pointer; .fiTop { width: 100%; img { diff --git a/src/view/sy_map.vue b/src/view/sy_map.vue index 79216b5..f979804 100644 --- a/src/view/sy_map.vue +++ b/src/view/sy_map.vue @@ -319,11 +319,24 @@ const xkzCenter = reactive([ }, ]); var map = null; + +const BMAP = () => { + // 添加鼠标点击事件监听器 + map.addEventListener("click", function (e) { + console.log(e.point, 666); + // console.log(e.latlng, 666); + var pt = e.point; // 获取点击的坐标 + var marker = new BMapGL.Marker(pt); // 创建标注 + map.addOverlay(marker); // 将标注添加到地图中 + }); +}; + const initMap = () => { map = new BMapGL.Map("map", { minZoom: 11, maxZoom: 20 }); map.enableScrollWheelZoom(true); map.setMapType(BMAP_EARTH_MAP); goMapCenter([119.178783, 29.034583], 12); + BMAP(); //加载乡镇信息 loadTown(); //渲染地块