/** * MapboxService */ import type { Bounds, ICoordinateSystemService, IGlobalConfigService, ILngLat, IMapCamera, IMapConfig, IMapService, IMercator, IPoint, IStatusOptions, IViewport, MapStyleConfig, MapStyleName, RaContainer } from '@ramap/ra-core'; import type { Map } from '@ramap/ra-map'; import type { ISimpleMapCoord } from './simpleMapCoord'; export default abstract class BaseMapService implements IMapService { version: string; map: Map & T; simpleMapCoord: ISimpleMapCoord; bgColor: string; protected abstract viewport: IViewport | unknown; protected readonly config: Partial; protected readonly configService: IGlobalConfigService; protected readonly coordinateSystemService: ICoordinateSystemService; protected eventEmitter: any; constructor(container: RaContainer); protected markerContainer: HTMLElement; protected cameraChangedCallback: (viewport: IViewport) => void; protected $mapContainer: HTMLElement | null; setBgColor(color: string): void; addMarkerContainer(): void; getMarkerContainer(): HTMLElement; getOverlayContainer(): HTMLElement | undefined; getCanvasOverlays(): HTMLElement | null | undefined; on(type: string, handle: (...args: any[]) => void): void; off(type: string, handle: (...args: any[]) => void): void; getContainer(): HTMLElement | null; getMapCanvasContainer(): HTMLElement; getSize(): [number, number]; getType(): string; getZoom(): number; setZoom(zoom: number): Map & T; getCenter(): ILngLat; setCenter(lnglat: [number, number]): void; getPitch(): number; getRotation(): number; getBounds(): Bounds; getMinZoom(): number; getMaxZoom(): number; setRotation(rotation: number): void; zoomIn(option?: any, eventData?: any): void; zoomOut(option?: any, eventData?: any): void; setPitch(pitch: number): Map & T; panTo(p: [number, number]): void; panBy(x?: number, y?: number): void; fitBounds(bound: Bounds, fitBoundsOptions?: any): void; setMaxZoom(max: number): void; setMinZoom(min: number): void; setMapStatus(option: Partial): void; setZoomAndCenter(zoom: number, center: [number, number]): void; setMapStyle(style: any): void; meterToCoord(center: [number, number], outer: [number, number]): number; pixelToLngLat(pixel: [number, number]): ILngLat; lngLatToPixel(lnglat: [number, number]): IPoint; containerToLngLat(pixel: [number, number]): ILngLat; lngLatToContainer(lnglat: [number, number]): IPoint; abstract lngLatToMercator(lnglat: [number, number], altitude: number): IMercator; abstract getModelMatrix(lnglat: [number, number], altitude: number, rotate: [number, number, number], scale: [number, number, number], origin: IMercator): number[]; getMapStyle(): string; getMapStyleConfig(): MapStyleConfig; getMapStyleValue(name: MapStyleName): any; abstract init(): Promise; destroy(): void; emit(name: string, ...args: any[]): void; once(name: string, ...args: any[]): void; getMapContainer(): HTMLElement | null; exportMap(type: 'jpg' | 'png'): string; onCameraChanged(callback: (viewport: IViewport) => void): void; protected handleCameraChanged: (e?: any) => void; protected creatMapContainer(id: string | HTMLDivElement): HTMLDivElement; updateView(viewOption: Partial): void; protected updateCoordinateSystemService(): void; }