张延森 před 3 roky
rodič
revize
752344218f
2 změnil soubory, kde provedl 5 přidání a 2 odebrání
  1. 3
    0
      src/components/AMap/loader.js
  2. 2
    2
      src/components/GeoMap/index.jsx

+ 3
- 0
src/components/AMap/loader.js Zobrazit soubor

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

+ 2
- 2
src/components/GeoMap/index.jsx Zobrazit soubor

15
     loader(plugins).then((AMap) => {
15
     loader(plugins).then((AMap) => {
16
       amapRef.current = AMap;
16
       amapRef.current = AMap;
17
       const mapInst = new AMap.Map(container.current, {
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
         zoom: 10,
20
         zoom: 10,
21
         resizeEnable: true,
21
         resizeEnable: true,
22
         center: [112.092716, 32.681642],
22
         center: [112.092716, 32.681642],