diff --git a/src/components/form/InputMap/amap.js b/src/components/form/InputMap/amap.js index c6deb53..e17db62 100644 --- a/src/components/form/InputMap/amap.js +++ b/src/components/form/InputMap/amap.js @@ -1,4 +1,6 @@ +// eslint-disable-next-line no-unused-vars let amapKey = process.env.VUE_APP_MAP_KEY +// eslint-disable-next-line no-unused-vars let amapVersion = '2.0' let _createScript = url => { let jsapi = document.createElement('script') @@ -8,11 +10,11 @@ let _createScript = url => { } export default () => { - return new Promise((resolve, reject) => { + return new Promise(resolve => { if (!window.AMap) { // 判断window下有没有AMap对象,再判断是否引入cdn地图 - _createScript(`https://webapi.amap.com/maps?v=${amapVersion}&key=${amapKey}.Key&callback=aMapInitCallback`) + _createScript('https://webapi.amap.com/maps?v=2.0&key=f2200337d0d08538e78729572749882d&&callback=aMapInitCallback') window.aMapInitCallback = () => { - _createScript('//webapi.amap.com/ui/1.1/main.js&callback=amapUiCallback') + _createScript('//webapi.amap.com/ui/1.1/main.js') // 创建定时器 当AMapUI有值的时候 清除定时器 并resolve let interval = setInterval(() => { if (window.AMapUI) { diff --git a/src/components/form/InputMap/index.vue b/src/components/form/InputMap/index.vue index 8c037f0..dce01f4 100644 --- a/src/components/form/InputMap/index.vue +++ b/src/components/form/InputMap/index.vue @@ -1,35 +1,320 @@ - + diff --git a/src/components/form/InputMap/index1.vue b/src/components/form/InputMap/index1.vue deleted file mode 100644 index 35d140d..0000000 --- a/src/components/form/InputMap/index1.vue +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/views/test.vue b/src/views/test.vue index 248d3f4..e5f3f55 100644 --- a/src/views/test.vue +++ b/src/views/test.vue @@ -12,7 +12,7 @@ import SignPad from '../components/form/SignPad' import pagination from '../components/form/pagination' import ProvinceCity from '@/components/form/ProvinceCity' -import InputMap from '@/components/form/InputMap' +import InputMap from '@/components/form/InputMap/index' export default { name: 'App', components: {