张延森 3 年之前
父節點
當前提交
752344218f
共有 2 個檔案被更改,包括 5 行新增2 行删除
  1. 3
    0
      src/components/AMap/loader.js
  2. 2
    2
      src/components/GeoMap/index.jsx

+ 3
- 0
src/components/AMap/loader.js 查看文件

@@ -4,6 +4,9 @@ const WEB_KEY = '7c02d93b855ab284c12911c231aa2233';
4 4
 const SERVER_KEY = 'a30b66a26ea1890fd656cf11cb2647fb';
5 5
 
6 6
 export default (plugins, uiPlugins) => {
7
+  window._AMapSecurityConfig = {
8
+    securityJsCode: 'bd6c192ebd3e0903f6ebe54b76d5e298',
9
+  };
7 10
   return AMapLoader.load({
8 11
     key: WEB_KEY, // 申请好的Web端开发者Key,首次调用 load 时必填
9 12
     version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15

+ 2
- 2
src/components/GeoMap/index.jsx 查看文件

@@ -15,8 +15,8 @@ export default (props) => {
15 15
     loader(plugins).then((AMap) => {
16 16
       amapRef.current = AMap;
17 17
       const mapInst = new AMap.Map(container.current, {
18
-        // mapStyle: 'amap://styles/669a7d8709a9bab0945747a1a1db3327',
19
-        mapStyle: 'amap://styles/blue',
18
+        mapStyle: 'amap://styles/669a7d8709a9bab0945747a1a1db3327',
19
+        // mapStyle: 'amap://styles/blue',
20 20
         zoom: 10,
21 21
         resizeEnable: true,
22 22
         center: [112.092716, 32.681642],