Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
map-demo
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-03-06 10:30:13 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f1aa9ab993d47cf2aff2a198188d6c661b6d14b3
f1aa9ab9
1 parent
96db4386
✨ feat(地图主体部分): 修改地图密钥引入方式
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
65 additions
and
11 deletions
index.html
src/views/activity.vue
src/views/bieyuan/map.vue
src/views/index.vue
src/views/inner.vue
src/views/tools.vue
src/views/xys/index.vue
index.html
View file @
f1aa9ab
<!--
* @Date: 2023-05-31 16:10:33
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 202
3-07-27 11:08:28
* @LastEditTime: 202
5-03-06 10:16:37
* @FilePath: /map-demo/index.html
* @Description: 文件描述
-->
...
...
@@ -26,6 +26,6 @@
// serviceHost: 'https://oa-dev.onwall.cn/_AMapService',
// }
</script>
<
script
src=
"https://webapi.amap.com/maps?v=2.0&key=381c6763e1fefd810fbab697f470149c&plugin=AMap.ElasticMarker,AMap.ImageLayer,AMap.ToolBar,AMap.IndoorMap"
></script
>
<
!-- <script src="https://webapi.amap.com/maps?v=2.0&key=381c6763e1fefd810fbab697f470149c&plugin=AMap.ElasticMarker,AMap.ImageLayer,AMap.ToolBar,AMap.IndoorMap,AMap.Walking,AMap.Geolocation,AMap.ToolBar"></script> --
>
</body>
</html>
...
...
src/views/activity.vue
View file @
f1aa9ab
...
...
@@ -176,6 +176,7 @@ import Floor from '@/components/Floor'
import { useRect } from '@vant/use';
import { mapAPI } from '@/api/map.js'
import wx from 'weixin-js-sdk'
import AMapLoader from '@amap/amap-jsapi-loader'
const GPS = {
PI: 3.14159265358979324,
...
...
@@ -232,7 +233,10 @@ const GPS = {
return ret;
}
};
// 关键安全配置
window._AMapSecurityConfig = {
securityJsCode: '8602057c4c8dae5bed9a240c0582c46f', // 替换为你的密钥
}
export default {
components: { InfoWindow, InfoWindowLite, InfoWindowWarn, InfoWindowYard, Floor },
data() {
...
...
@@ -324,6 +328,11 @@ export default {
}
},
async mounted() {
const AMap = await AMapLoader.load({
key: '381c6763e1fefd810fbab697f470149c', // 控制台获取
version: '2.0', // 指定API版本
plugins: ['AMap.ElasticMarker','AMap.ImageLayer','AMap.ToolBar','AMap.IndoorMap','AMap.Walking','AMap.Geolocation'] // 必须加载步行导航插件
})
const code = this.$route.query.id;
const { data } = await mapAPI({i: code});
// data.list = data.list.concat(map_yard);
...
...
src/views/bieyuan/map.vue
View file @
f1aa9ab
<!--
* @Date: 2023-05-19 14:54:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-0
2-10 17:45:25
* @LastEditTime: 2025-0
3-06 10:28:52
* @FilePath: /map-demo/src/views/bieyuan/map.vue
* @Description: 公众地图主体页面
-->
...
...
@@ -96,6 +96,7 @@ import audioBackground1 from '@/components/audioBackground1.vue'
import { mapState, mapActions } from 'pinia'
import { mainStore } from '@/store'
import { parseQueryString } from '@/utils/tools'
import AMapLoader from '@amap/amap-jsapi-loader'
const GPS = {
PI: 3.14159265358979324,
...
...
@@ -152,7 +153,10 @@ const GPS = {
return ret;
}
};
// 关键安全配置
window._AMapSecurityConfig = {
securityJsCode: '8602057c4c8dae5bed9a240c0582c46f', // 替换为你的密钥
}
export default {
components: { pageInfo, audioBackground1 },
data() {
...
...
@@ -268,6 +272,11 @@ export default {
}
},
async mounted() {
const AMap = await AMapLoader.load({
key: '381c6763e1fefd810fbab697f470149c', // 控制台获取
version: '2.0', // 指定API版本
plugins: ['AMap.ElasticMarker','AMap.ImageLayer','AMap.ToolBar','AMap.IndoorMap','AMap.Walking','AMap.Geolocation'] // 必须加载步行导航插件
})
const code = this.$route.query.id;
const { data } = await mapAPI({ i: code });
this.navBarList = data.list; // 底部导航条
...
...
src/views/index.vue
View file @
f1aa9ab
<!--
* @Date: 2023-05-19 14:54:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-0
2-25 16:51:1
4
* @LastEditTime: 2025-0
3-06 10:29:0
4
* @FilePath: /map-demo/src/views/index.vue
* @Description: 公众地图主体页面
-->
...
...
@@ -124,6 +124,7 @@ import wx from 'weixin-js-sdk'
import InfoPopup from '@/components/InfoPopup'
import InfoPopupLite from '@/components/InfoPopupLite'
import InfoPopupWarn from '@/components/InfoPopupWarn'
import AMapLoader from '@amap/amap-jsapi-loader'
const GPS = {
PI: 3.14159265358979324,
...
...
@@ -180,7 +181,10 @@ const GPS = {
return ret;
}
};
// 关键安全配置
window._AMapSecurityConfig = {
securityJsCode: '8602057c4c8dae5bed9a240c0582c46f', // 替换为你的密钥
}
export default {
components: { InfoWindow, InfoWindowLite, InfoWindowWarn, audioBackground, InfoPopup, InfoPopupLite, InfoPopupWarn },
data() {
...
...
@@ -264,6 +268,11 @@ export default {
}
},
async mounted() {
const AMap = await AMapLoader.load({
key: '381c6763e1fefd810fbab697f470149c', // 控制台获取
version: '2.0', // 指定API版本
plugins: ['AMap.ElasticMarker','AMap.ImageLayer','AMap.ToolBar','AMap.IndoorMap','AMap.Walking','AMap.Geolocation'] // 必须加载步行导航插件
})
const code = this.$route.query.id;
const { data } = await mapAPI({ i: code });
// TAG:预警显示
...
...
src/views/inner.vue
View file @
f1aa9ab
...
...
@@ -143,6 +143,7 @@ import Floor from '@/components/Floor'
import { useRect } from '@vant/use';
import { mapAPI } from '@/api/map.js'
import wx from 'weixin-js-sdk'
import AMapLoader from '@amap/amap-jsapi-loader'
const GPS = {
PI: 3.14159265358979324,
...
...
@@ -199,7 +200,10 @@ const GPS = {
return ret;
}
};
// 关键安全配置
window._AMapSecurityConfig = {
securityJsCode: '8602057c4c8dae5bed9a240c0582c46f', // 替换为你的密钥
}
export default {
components: { InfoWindow, InfoWindowLite, InfoWindowWarn, InfoWindowYard, Floor },
data() {
...
...
@@ -281,6 +285,11 @@ export default {
}
},
async mounted() {
const AMap = await AMapLoader.load({
key: '381c6763e1fefd810fbab697f470149c', // 控制台获取
version: '2.0', // 指定API版本
plugins: ['AMap.ElasticMarker','AMap.ImageLayer','AMap.ToolBar','AMap.IndoorMap','AMap.Walking','AMap.Geolocation'] // 必须加载步行导航插件
})
const code = this.$route.query.id;
const { data } = await mapAPI({i: code});
data.list = data.list.concat(map_yard);
...
...
src/views/tools.vue
View file @
f1aa9ab
<!--
* @Date: 2023-05-19 14:54:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-0
2-27 09:32:49
* @LastEditTime: 2025-0
3-06 10:29:14
* @FilePath: /map-demo/src/views/tools.vue
* @Description: 公众地图主体页面
-->
...
...
@@ -126,6 +126,7 @@ import { useRect } from '@vant/use';
import { mapAPI } from '@/api/map.js'
import wx from 'weixin-js-sdk'
import { showToast } from 'vant';
import AMapLoader from '@amap/amap-jsapi-loader'
const GPS = {
PI: 3.14159265358979324,
...
...
@@ -182,7 +183,10 @@ const GPS = {
return ret;
}
};
// 关键安全配置
window._AMapSecurityConfig = {
securityJsCode: '8602057c4c8dae5bed9a240c0582c46f', // 替换为你的密钥
}
export default {
components: { InfoWindow, InfoWindowLite, InfoWindowWarn, audioBackground },
data() {
...
...
@@ -265,6 +269,11 @@ export default {
}
},
async mounted() {
const AMap = await AMapLoader.load({
key: '381c6763e1fefd810fbab697f470149c', // 控制台获取
version: '2.0', // 指定API版本
plugins: ['AMap.ElasticMarker','AMap.ImageLayer','AMap.ToolBar','AMap.IndoorMap','AMap.Walking','AMap.Geolocation'] // 必须加载步行导航插件
})
const code = this.$route.query.id;
const { data } = await mapAPI({ i: code });
data.list = data.list.concat(map_alert);
...
...
src/views/xys/index.vue
View file @
f1aa9ab
...
...
@@ -124,6 +124,7 @@ import wx from 'weixin-js-sdk'
import InfoPopup from '@/components/InfoPopup'
import InfoPopupLite from '@/components/InfoPopupLite'
import InfoPopupWarn from '@/components/InfoPopupWarn'
import AMapLoader from '@amap/amap-jsapi-loader'
const GPS = {
PI: 3.14159265358979324,
...
...
@@ -180,7 +181,10 @@ const GPS = {
return ret;
}
};
// 关键安全配置
window._AMapSecurityConfig = {
securityJsCode: '8602057c4c8dae5bed9a240c0582c46f', // 替换为你的密钥
}
export default {
components: { InfoWindow, InfoWindowLite, InfoWindowWarn, audioBackground, InfoPopup, InfoPopupLite, InfoPopupWarn },
data() {
...
...
@@ -265,6 +269,11 @@ export default {
}
},
async mounted() {
const AMap = await AMapLoader.load({
key: '381c6763e1fefd810fbab697f470149c', // 控制台获取
version: '2.0', // 指定API版本
plugins: ['AMap.ElasticMarker','AMap.ImageLayer','AMap.ToolBar','AMap.IndoorMap','AMap.Walking','AMap.Geolocation'] // 必须加载步行导航插件
})
const code = this.$route.query.id;
const { data } = await mapAPI({ i: code });
// TAG:预警显示
...
...
Please
register
or
login
to post a comment