@@ -2,7 +2,7 @@ import AMapLoader from '@amap/amap-jsapi-loader' | |||
export default AMapLoader.load({ | |||
'key': '709c024e3faa4a92473b9d847ca87702', | |||
'version': '2.0', | |||
'version': '1.4.4', | |||
'plugins': ['AMap.ToolBar', 'AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Geocoder'], | |||
AMapUI: { | |||
version: '1.1', |
@@ -46,14 +46,12 @@ nextTick(() => { | |||
}) | |||
}) | |||
map.on('click', ({ lnglat }) => { | |||
console.log(1111) | |||
if (marker) map.remove(marker) // 只取一次maker点 | |||
marker = new AMap.Marker({ | |||
position: new AMap.LngLat(lnglat.lng, lnglat.lat), | |||
offset: new AMap.Pixel(-10, -10), | |||
icon: '//vdata.amap.com/icons/b18/1/2.png' | |||
}) | |||
console.log(map, marker) | |||
map.add(marker) | |||
emit('mapEmit', lnglat) | |||
}) |