mirror of https://gitee.com/antv-l7/antv-l7
Fix token warn (#1540)
* fix: 文本更新 * fix: iconfont 更新 * fix: 移除console * docs: scene 增加 setzoom * fix: 地图实例demo * fix: polygon triangle * fix: polygon triangle dimensions * fix: 高德地图v2 坐标转换 * fix: 地图token 警告提醒 * fix: 标准化警告文案 * fix: lint error
This commit is contained in:
parent
1347639c8f
commit
8241f5a872
|
@ -5,7 +5,7 @@ export interface IWarnInfo {
|
|||
}
|
||||
const WarnInfo: IWarnInfo = {
|
||||
MapToken:
|
||||
'您正在使用 Demo测试地图token,如果生产环境中使用去对应地图请注册Token',
|
||||
'您正在使用 Demo 测试 Token, 生产环境务必自行注册 Token 确保服务稳定',
|
||||
SDK: '请确认引入了mapbox-gl api且在L7之前引入',
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue