diff --git a/index.html b/index.html index cbecd3e..57ea248 100644 --- a/index.html +++ b/index.html @@ -8,6 +8,7 @@ content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> + 奉节旅游调度 diff --git a/src/assets/images/icon-13.png b/src/assets/images/icon-13.png new file mode 100644 index 0000000..5bc66c1 Binary files /dev/null and b/src/assets/images/icon-13.png differ diff --git a/src/assets/images/icon-14.png b/src/assets/images/icon-14.png new file mode 100644 index 0000000..9f36cdc Binary files /dev/null and b/src/assets/images/icon-14.png differ diff --git a/src/assets/images/icon-15.png b/src/assets/images/icon-15.png new file mode 100644 index 0000000..5635799 Binary files /dev/null and b/src/assets/images/icon-15.png differ diff --git a/src/assets/images/icon-16.png b/src/assets/images/icon-16.png new file mode 100644 index 0000000..32f4041 Binary files /dev/null and b/src/assets/images/icon-16.png differ diff --git a/src/assets/images/icon-17.png b/src/assets/images/icon-17.png new file mode 100644 index 0000000..a280912 Binary files /dev/null and b/src/assets/images/icon-17.png differ diff --git a/src/assets/images/icon-18.png b/src/assets/images/icon-18.png new file mode 100644 index 0000000..7b19216 Binary files /dev/null and b/src/assets/images/icon-18.png differ diff --git a/src/assets/images/icon-19.png b/src/assets/images/icon-19.png new file mode 100644 index 0000000..20de1bb Binary files /dev/null and b/src/assets/images/icon-19.png differ diff --git a/src/assets/images/icon-20.png b/src/assets/images/icon-20.png new file mode 100644 index 0000000..1bd7b7b Binary files /dev/null and b/src/assets/images/icon-20.png differ diff --git a/src/assets/images/marker-title.png b/src/assets/images/marker-title.png new file mode 100644 index 0000000..c2da09d Binary files /dev/null and b/src/assets/images/marker-title.png differ diff --git a/src/hooks/map.js b/src/hooks/map.js index dec53fe..05751a4 100644 --- a/src/hooks/map.js +++ b/src/hooks/map.js @@ -3,6 +3,7 @@ import { ref } from 'vue' export function useMap() { let map = ref(null) let marker = ref(null) + // 初始化地图 const initMap = (id, lat, lng, scale = 15, satellite) => { map.value = new BMapGL.Map(id) @@ -27,11 +28,36 @@ export function useMap() { // 创建标注对象并添加到地图 marker.value = new BMapGL.Marker(point, { icon: iconPath }) map.value.addOverlay(marker.value) + // marker.value.addEventListener('click', (e) => { + // console.log(e, '===') + // if (!infoBox.value) { + // setInfoBox(e.latLng) + // } else { + // if (lastInfoBox.value) lastInfoBox.value?.close() + // infoBox.value.open(e.latLng) + // lastInfoBox.value = infoBox.value + // } + // // const content = ` + // //
+ // //

标题

+ // //

这里是详细信息

+ // //
+ // // ` + // // var infoWindow = new BMapGL.InfoWindow(content) // 创建信息窗口对象 + // // console.log(map.value.getCenter()) + // // map.value.openInfoWindow(infoWindow, e.latLng) // 打开信息窗口 + // // const infoWindow = new BMapGL.InfoWindow('这里是一些信息') // 创建信息窗口对象 + // // marker.value.openInfoWindow(infoWindow) // 打开信息窗口 + // }) } + // 清除覆盖物 const clearOverlays = () => { map.value.clearOverlays() } - - return { map, marker, initMap, addMarker, clearOverlays } + // 清除某一个覆盖物 + const removeOverlay = (i) => { + map.value.removeOverlay(i) + } + return { map, marker, initMap, addMarker, clearOverlays, removeOverlay } } diff --git a/src/views/scenic/components/big-car-ship-map.vue b/src/views/scenic/components/big-car-ship-map.vue index 39fd33b..e41425f 100644 --- a/src/views/scenic/components/big-car-ship-map.vue +++ b/src/views/scenic/components/big-car-ship-map.vue @@ -10,10 +10,19 @@ +