diff --git a/packages/core/src/services/config/warnInfo.ts b/packages/core/src/services/config/warnInfo.ts index 6337797d1c..bb8e28acce 100644 --- a/packages/core/src/services/config/warnInfo.ts +++ b/packages/core/src/services/config/warnInfo.ts @@ -5,7 +5,7 @@ export interface IWarnInfo { } const WarnInfo: IWarnInfo = { MapToken: - '您正在使用 Demo测试地图token,如果生产环境中使用去对应地图请注册Token', + '您正在使用 Demo 测试 Token, 生产环境务必自行注册 Token 确保服务稳定', SDK: '请确认引入了mapbox-gl api且在L7之前引入', }; diff --git a/packages/maps/src/amap2/map.ts b/packages/maps/src/amap2/map.ts index a3bfcf7538..3bcdb24a78 100644 --- a/packages/maps/src/amap2/map.ts +++ b/packages/maps/src/amap2/map.ts @@ -283,6 +283,12 @@ export default class AMapService extends AMapBaseService { // 高德地图在相同大小下需要比 MapBox 多一个 zoom 层级 mapConstructorOptions.zoom += 1; } + if (token === AMAP_API_KEY) { + console.warn( + `%c${this.configService.getSceneWarninfo('MapToken')}!`, + 'color: #873bf4;font-weigh:900;font-size: 16px;', + ); + } // @ts-ignore const map = new AMap.Map(this.$mapContainer, mapConstructorOptions); // @ts-ignore diff --git a/packages/maps/src/utils/amap/AMapBaseService.ts b/packages/maps/src/utils/amap/AMapBaseService.ts index 0ce9188518..350c56245f 100644 --- a/packages/maps/src/utils/amap/AMapBaseService.ts +++ b/packages/maps/src/utils/amap/AMapBaseService.ts @@ -411,7 +411,7 @@ export default abstract class AMapBaseService }; if (!amapLoaded && !mapInstance) { if (token === AMAP_API_KEY) { - console.warn(this.configService.getSceneWarninfo('MapToken')); + console.warn(`%c${this.configService.getSceneWarninfo('MapToken')}!`,'color: #873bf4;font-weigh:900;font-size: 16px;'); } amapLoaded = true; plugin.push('Map3D'); diff --git a/packages/utils/src/workers/triangulation.ts b/packages/utils/src/workers/triangulation.ts index 3f5bc8f69c..716887a2c2 100644 --- a/packages/utils/src/workers/triangulation.ts +++ b/packages/utils/src/workers/triangulation.ts @@ -83,17 +83,15 @@ export function polygonFillTriangulation(feature: IEncodeFeature) { } function project_y(y: number) { - - if(y > 85 || y<-85) { - return y + if (y > 85 || y < -85) { + return y; } return Math.log(Math.tan((Math.PI * y) / 360)); } function un_project_y(y: number) { - - if(y > 85 || y<-85) { - return y + if (y > 85 || y < -85) { + return y; } return (Math.atan(Math.exp(y)) * 360) / Math.PI; }