feat(platform): integrate runtime amap vehicle maps
This commit is contained in:
18
vehicle-data-platform/apps/web/src/config/appConfig.ts
Normal file
18
vehicle-data-platform/apps/web/src/config/appConfig.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
export type AMapRuntimeConfig = {
|
||||
webJsKey: string;
|
||||
securityJsCode: string;
|
||||
securityServiceHost: string;
|
||||
};
|
||||
|
||||
export function getAMapConfig(): AMapRuntimeConfig {
|
||||
const runtime = window.__LINGNIU_APP_CONFIG__ ?? {};
|
||||
return {
|
||||
webJsKey: String(runtime.amapWebJsKey || import.meta.env.VITE_AMAP_WEB_JS_KEY || '').trim(),
|
||||
securityJsCode: String(runtime.amapSecurityJsCode || '').trim(),
|
||||
securityServiceHost: String(runtime.amapSecurityServiceHost || '').trim()
|
||||
};
|
||||
}
|
||||
|
||||
export function isAMapConfigured(config = getAMapConfig()) {
|
||||
return Boolean(config.webJsKey);
|
||||
}
|
||||
Reference in New Issue
Block a user