import { EventEmitter , ViewContainerRef } from '@angular/core' ; import { Observable , throwError , EMPTY } from 'rxjs' ; import { GeoJsonObject , Point } from 'geojson' ; import { ImageryMapExtent , IImageryMapPosition , IMousePointerMove } from './case-map-position.model' ; import { IMapErrorMessage , IMapProgress } from './map-progress.model' ; import { IBaseImageryLayer } from './imagery-layer.model' ; import { EPSG_4326 } from '../utils/geo' ; import { IExportMapMetadata } from './export-map.model' ; export interface IImageryMapMetaData { deps ? : any [ ] ; mapType ? : string ; defaultMapSource ? : string ; } export interface ICanvasExportData { width : number ; height : number ; data : string ; } export interface IBaseImageryMapConstructor { groupLayers : Map < string , IBaseImageryLayer > ; new ( ... args ) : BaseImageryMap ; } export abstract class BaseImageryMap < T = any > { static groupLayers = new Map < string , IBaseImageryLayer > ( ) ; readonly deps ? : any [ ] ; readonly mapType ? : string ; readonly defaultMapSource ? : string ; public positionChanged : EventEmitter < IImageryMapPosition > = new EventEmitter < IImageryMapPosition > ( ) ; public mousePointerMoved : EventEmitter < IMousePointerMove > = new EventEmitter < IMousePointerMove > ( ) ; public moveStart : EventEmitter < IImageryMapPosition > = new EventEmitter < IImageryMapPosition > ( ) ; public tilesLoadProgressEventEmitter : EventEmitter < IMapProgress > = new EventEmitter < IMapProgress > ( ) ; public tilesLoadErrorEventEmitter : EventEmitter < IMapErrorMessage > = new EventEmitter < IMapErrorMessage > ( ) ; public abstract mapObject : T ; abstract getCenter ( ) ; abstract setCenter ( center , animation ) ; abstract toggleGroup ( groupName , newState ) ; abstract initMap ( element , shadowNorthElement , shadowDoubleBufferElement , layer ? , position ? , mapViewContainerRef ? ) ; initMapSubscriptions ( ) { } ; description param layer param extent abstract resetView ( layer , position , extent ? , useDoubleBuffer ? ) ; abstract addLayer ( layer ) ; addMapLayer ( layer ) { throw new Error ( 'Method not implemented.' ) ; } ; getMainLayer ( ) { throw new Error ( 'Method not implemented.' ) ; } abstract getLayers ( ) ; abstract getGroupLayers ( ) ; abstract removeLayer ( layer ) ; abstract setPosition ( position ) ; abstract setRotation ( rotation ) ; abstract getRotation ( ) ; abstract zoomIn ( ) ; abstract zoomOut ( ) ; abstract one2one ( ) ; abstract getPosition ( ) ; abstract updateSize ( ) ; abstract addGeojsonLayer ( data ) ; abstract dispose ( ) ; abstract addLayerIfNotExist ( layer ) ; abstract getCoordinateFromScreenPixel ( screenPixel ) ; abstract getHtmlContainer ( ) ; getProjectionCode ( ) { return EPSG_4326 ; } getProjection ( ) { return EPSG_4326 ; } fitToExtent ( extent ) { return EMPTY ; } ; getExtraData ( ) { return { } ; } exportMap ( exportMetadata ) { return throwError ( `Method not implement on ${ this . mapType }` ) ; } }