|
@@ -0,0 +1,31 @@
|
|
1
|
+<template>
|
|
2
|
+ <div class="page" ref="el"></div>
|
|
3
|
+</template>
|
|
4
|
+
|
|
5
|
+<script setup>
|
|
6
|
+ import { onMounted, ref } from 'vue';
|
|
7
|
+ // import AMapLoader from '@amap/amap-jsapi-loader';
|
|
8
|
+
|
|
9
|
+ const el = ref();
|
|
10
|
+
|
|
11
|
+ onMounted(() => {
|
|
12
|
+ const map = new BMap.Map(el.value);
|
|
13
|
+ const point = new BMap.Point(116.404, 39.915); // 天安门
|
|
14
|
+ map.centerAndZoom(point, 3);
|
|
15
|
+ // window._AMapSecurityConfig = {
|
|
16
|
+ // securityJsCode:'f33684b9573195f9f91a4c8bc779d7e2',
|
|
17
|
+ // }
|
|
18
|
+ // AMapLoader.load({
|
|
19
|
+ // key: "378f2af0c01b00ec919ace1699f2466f", // 申请好的Web端开发者Key,首次调用 load 时必填
|
|
20
|
+ // version: "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
|
21
|
+ // plugins: [], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
|
22
|
+ // }).then((AMap)=>{
|
|
23
|
+ // const map = new AMap.Map(el.value, {
|
|
24
|
+ // mapStyle: 'amap://styles/bff59c60c62af794ee93f1befde78625',
|
|
25
|
+ // zoom: 3,
|
|
26
|
+ // });
|
|
27
|
+ // }).catch(e => {
|
|
28
|
+ // console.error(e);
|
|
29
|
+ // })
|
|
30
|
+ });
|
|
31
|
+</script>
|