You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
801 B
26 lines
801 B
import AMapLoader from '@amap/amap-jsapi-loader'; |
|
import { AMAP_KEY, SECURITY_JS_CODE } from './const'; |
|
// @ts-ignore |
|
window['_AMapSecurityConfig'] = { |
|
securityJsCode: SECURITY_JS_CODE, |
|
}; |
|
export function getAMapLoader({ aMapUI = false, aMapLoca = false }) { |
|
const config = { |
|
key: AMAP_KEY, |
|
version: '1.4.15', |
|
plugins: [], // 需要使用的的插件列表,如比例尺'AMap.Scale'等 |
|
}; |
|
if (aMapUI) { |
|
config['AMapUI'] = { |
|
version: '1.1', |
|
plugins: [], // 需要加载的 AMapUI ui插件 |
|
}; |
|
} |
|
if (aMapLoca) { |
|
config['Loca'] = { |
|
version: '1.3.2', // Loca 版本,缺省 1.3.2 |
|
// version: '2.0', // Loca 版本,缺省 1.3.2 |
|
}; |
|
} |
|
return AMapLoader.load(config); |
|
}
|
|
|