Interface MapAdapter<M, L, C>

Parameters and methods that control the behavior of the map and the layers on it.

interface MapAdapter<M, L, C> {
    controlAdapters: {
        [name: string]: Type<C>;
    };
    emitter: StrictEventEmitter<EventEmitter<DefaultEventMap>, MapAdapterEvents>;
    isLoaded?: boolean;
    layerAdapters: {
        [name: string]: Type<LayerAdapter<M, L, any>>;
    };
    map?: M;
    addControl<K>(controlName: any, position: ControlPosition, options?: MapControls[K]): any;
    beforeRemove?(): void;
    create(options?: MapOptions<any, any>): void;
    createButtonControl?(options: ButtonControlOptions): C;
    createControl?(control: MapControl<any>, options?: CreateControlOptions): C;
    createToggleControl?(options: ToggleControlOptions): C;
    destroy(): void;
    fetchZoom?(): Promise<undefined | number>;
    fit?(extent: LngLatBoundsArray, options?: FitOptions): void;
    fitBounds(extent: LngLatBoundsArray, options?: FitOptions): void;
    getBounds?(): undefined | LngLatBoundsArray;
    getCenter(): undefined | LngLatArray;
    getContainer(): undefined | HTMLElement;
    getControlContainer?(): HTMLElement;
    getCursor?(): undefined | string;
    getZoom(): undefined | number;
    hideLayer(layer: L): void;
    locate?(opt: LocateOptions, events?: LocationEvents): Locate;
    onMapClick(evt: any): void;
    removeControl(control: any): void;
    removeLayer(layer: L): any;
    setCenter(latLng: LngLatArray): void;
    setCursor?(cursor: string): void;
    setLayerOpacity(layer: L, opacity: number): void;
    setLayerOrder(layer: L, order: number, layers?: {
        [name: string]: LayerAdapter;
    }): void;
    setView?(lngLat: LngLatArray, zoom?: number): void;
    setView?(viewOptions: ViewOptions): void;
    setZoom(zoom: number): void;
    showLayer(layer: L): void;
    zoomIn?(): void;
    zoomOut?(): void;
}

Type Parameters

  • M = any

    WEB-GIS framework map interface

  • L = any

    WEB-GIS framework layer interface

  • C = any

    WEB-GIS framework control interface

Implemented by

    Properties

    controlAdapters: {
        [name: string]: Type<C>;
    }

    Named map controls specific for each framework.

    emitter: StrictEventEmitter<EventEmitter<DefaultEventMap>, MapAdapterEvents>

    An instance of the EventEmitter class for listen and emit events

    isLoaded?: boolean

    State of readiness of the card for use.

    true
    
    layerAdapters: {
        [name: string]: Type<LayerAdapter<M, L, any>>;
    }

    Named adapters for map layers through a generic interface.

    map?: M

    Original map object of GIS framework (Leaflet.Map, Openlayers.Map, MaplibreGL.Map or other)

    Methods

    • Tries to locate the user using the Geolocation API, firing a locationfound event with location data on success or a locationerror event on failure, and optionally sets the map view to the user's location with respect to detection accuracy (or to the world view if geolocation failed). Note that, if your page doesn't use HTTPS, this method will fail in modern browsers (Chrome 50 and newer) See Locate options for more details.

      Parameters

      Returns Locate