Skip to content

Commit

Permalink
fix: 高德地图密钥初始化时机
Browse files Browse the repository at this point in the history
  • Loading branch information
lzxue committed Oct 25, 2023
1 parent 124681b commit 6b1d38b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/maps/src/amap2/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ const DEFAULTMAPCENTER = [108.92361, 34.54083];

// @ts-ignore
window.forceWebGL = true;
// @ts-ignore
window._AMapSecurityConfig = {
securityJsCode: '2653011adeb04230b3a26cc9a780a800',
};

const AMAP_API_KEY: string = 'f59bcf249433f8b05caaee19f349b3d7';
// 'ff533602d57df6f8ab3b0fea226ae52f';
const AMAP_VERSION: string = '2.0';
Expand Down Expand Up @@ -317,6 +312,11 @@ export default class AMapService extends AMapBaseService {
mapConstructorOptions.zoom += 1;
}
if (token === AMAP_API_KEY) {
// @ts-ignore
window._AMapSecurityConfig = {
securityJsCode: '2653011adeb04230b3a26cc9a780a800',
};

console.warn(
`%c${this.configService.getSceneWarninfo('MapToken')}!`,
'color: #873bf4;font-weigh:900;font-size: 16px;',
Expand Down

0 comments on commit 6b1d38b

Please sign in to comment.