fix: 修复地图对 simpleMapCoord 的声明

This commit is contained in:
2912401452 2022-03-23 16:21:21 +08:00
parent 41432546a6
commit fc77a02179
7 changed files with 10 additions and 9 deletions

View File

@ -30,6 +30,7 @@ import { Version } from '../version';
import './logo.css'; import './logo.css';
import { MapTheme } from './theme'; import { MapTheme } from './theme';
import Viewport from './Viewport'; import Viewport from './Viewport';
import SimpleMapCoord from '../simpleMapCoord';
let mapdivCount = 0; let mapdivCount = 0;
// @ts-ignore // @ts-ignore
window.forceWebGL = true; window.forceWebGL = true;
@ -57,7 +58,7 @@ const LNGLAT_OFFSET_ZOOM_THRESHOLD = 12; // 暂时关闭 fix 统一不同坐标
export default class AMapService export default class AMapService
implements IMapService<AMap.Map & IAMapInstance> { implements IMapService<AMap.Map & IAMapInstance> {
public version: string = Version['GAODE1.x']; public version: string = Version['GAODE1.x'];
public simpleMapCoord: SimpleCoordinate; public simpleMapCoord: SimpleCoordinate = new SimpleMapCoord();
/** /**
* *
*/ */

View File

@ -24,7 +24,7 @@ import { DOM } from '@antv/l7-utils';
import { mat4, vec2, vec3 } from 'gl-matrix'; import { mat4, vec2, vec3 } from 'gl-matrix';
import { inject, injectable } from 'inversify'; import { inject, injectable } from 'inversify';
import 'reflect-metadata'; import 'reflect-metadata';
import { SimpleCoordinate } from '..'; import SimpleMapCoord from '../simpleMapCoord';
import { IAMapEvent, IAMapInstance } from '../../typings/index'; import { IAMapEvent, IAMapInstance } from '../../typings/index';
import { toPaddingOptions } from '../utils'; import { toPaddingOptions } from '../utils';
import { Version } from '../version'; import { Version } from '../version';
@ -60,7 +60,7 @@ let pendingResolveQueue: Array<() => void> = [];
export default class AMapService export default class AMapService
implements IMapService<AMap.Map & IAMapInstance> { implements IMapService<AMap.Map & IAMapInstance> {
public version: string = Version['GAODE2.x']; public version: string = Version['GAODE2.x'];
public simpleMapCoord: SimpleCoordinate; public simpleMapCoord: SimpleMapCoord = new SimpleMapCoord();
/** /**
* *
*/ */

View File

@ -31,8 +31,8 @@ const EventMap: {
zoomchange: 'zoom', zoomchange: 'zoom',
dragging: 'drag', dragging: 'drag',
}; };
import { SimpleCoordinate } from '..';
import { MapTheme } from './theme'; import { MapTheme } from './theme';
import SimpleMapCoord from '../simpleMapCoord';
const LNGLAT_OFFSET_ZOOM_THRESHOLD = 12; const LNGLAT_OFFSET_ZOOM_THRESHOLD = 12;
/** /**
@ -42,7 +42,7 @@ const LNGLAT_OFFSET_ZOOM_THRESHOLD = 12;
export default class L7EarthService implements IEarthService<Map> { export default class L7EarthService implements IEarthService<Map> {
public version: string = Version.GLOBEL; public version: string = Version.GLOBEL;
public map: Map; public map: Map;
public simpleMapCoord: SimpleCoordinate; public simpleMapCoord: SimpleMapCoord = new SimpleMapCoord();
// TODO: 判断地图是否正在拖拽 // TODO: 判断地图是否正在拖拽
public dragging: boolean = false; public dragging: boolean = false;

View File

@ -4,7 +4,7 @@ import GaodeMapV2 from './amap2/';
import Earth from './earth/'; import Earth from './earth/';
// import GaodeMapV2 from './amap2/'; // import GaodeMapV2 from './amap2/';
import Map from './map/'; import Map from './map/';
import SimpleCoordinate from './map/simpleMapCoord'; import SimpleCoordinate from './simpleMapCoord';
import Mapbox from './mapbox/'; import Mapbox from './mapbox/';
import { Version } from './version'; import { Version } from './version';

View File

@ -22,7 +22,7 @@ import { $window, DOM } from '@antv/l7-utils';
import { inject, injectable } from 'inversify'; import { inject, injectable } from 'inversify';
import 'reflect-metadata'; import 'reflect-metadata';
import { Version } from '../version'; import { Version } from '../version';
import SimpleMapCoord from './simpleMapCoord'; import SimpleMapCoord from '../simpleMapCoord';
import Viewport from './Viewport'; import Viewport from './Viewport';
const EventMap: { const EventMap: {
[key: string]: any; [key: string]: any;

View File

@ -36,7 +36,7 @@ const EventMap: {
zoomchange: 'zoom', zoomchange: 'zoom',
dragging: 'drag', dragging: 'drag',
}; };
import { SimpleCoordinate } from '..'; import SimpleMapCoord from '../simpleMapCoord';
import { MapTheme } from './theme'; import { MapTheme } from './theme';
let mapdivCount = 0; let mapdivCount = 0;
const LNGLAT_OFFSET_ZOOM_THRESHOLD = 12; const LNGLAT_OFFSET_ZOOM_THRESHOLD = 12;
@ -50,7 +50,7 @@ export default class MapboxService
implements IMapService<Map & IMapboxInstance> { implements IMapService<Map & IMapboxInstance> {
public version: string = Version.MAPBOX; public version: string = Version.MAPBOX;
public map: Map & IMapboxInstance; public map: Map & IMapboxInstance;
public simpleMapCoord: SimpleCoordinate; public simpleMapCoord: SimpleMapCoord = new SimpleMapCoord();
// 背景色 // 背景色
public bgColor: string = 'rgba(0.0, 0.0, 0.0, 0.0)'; public bgColor: string = 'rgba(0.0, 0.0, 0.0, 0.0)';