Browse Source

add log

tags/v1.0.0
zhangtao 2 years ago
parent
commit
a6b7bd58fc
2 changed files with 1 additions and 3 deletions
  1. +1
    -1
      src/utils/map/GMap.js
  2. +0
    -2
      src/views/task-manage/components/MapComp.vue

+ 1
- 1
src/utils/map/GMap.js View File



export default AMapLoader.load({ export default AMapLoader.load({
'key': '709c024e3faa4a92473b9d847ca87702', 'key': '709c024e3faa4a92473b9d847ca87702',
'version': '2.0',
'version': '1.4.4',
'plugins': ['AMap.ToolBar', 'AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Geocoder'], 'plugins': ['AMap.ToolBar', 'AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Geocoder'],
AMapUI: { AMapUI: {
version: '1.1', version: '1.1',

+ 0
- 2
src/views/task-manage/components/MapComp.vue View File

}) })
}) })
map.on('click', ({ lnglat }) => { map.on('click', ({ lnglat }) => {
console.log(1111)
if (marker) map.remove(marker) // 只取一次maker点 if (marker) map.remove(marker) // 只取一次maker点
marker = new AMap.Marker({ marker = new AMap.Marker({
position: new AMap.LngLat(lnglat.lng, lnglat.lat), position: new AMap.LngLat(lnglat.lng, lnglat.lat),
offset: new AMap.Pixel(-10, -10), offset: new AMap.Pixel(-10, -10),
icon: '//vdata.amap.com/icons/b18/1/2.png' icon: '//vdata.amap.com/icons/b18/1/2.png'
}) })
console.log(map, marker)
map.add(marker) map.add(marker)
emit('mapEmit', lnglat) emit('mapEmit', lnglat)
}) })

Loading…
Cancel
Save