File

libs/map/src/lib/base/map-cache.service.ts

Index

Properties
Methods

Methods

Public deleteMap
deleteMap(id: string)
Parameters :
Name Type Optional
id string No
Returns : boolean
Public getMap
getMap(id: string)
Parameters :
Name Type Optional
id string No
Returns : L.Map
Public hasMap
hasMap(id: string)
Parameters :
Name Type Optional
id string No
Returns : boolean
Public setMap
setMap(id: string, map: L.Map)
Parameters :
Name Type Optional
id string No
map L.Map No
Returns : void

Properties

Private mapCache
Type : Map<string | any>
Default value : new Map<string, any>()
import { Injectable } from '@angular/core';
import * as L from 'leaflet';

@Injectable()
export class MapCache {

    private mapCache: Map<string, any> = new Map<string, any>();

    public getMap(id: string): L.Map {
        return this.mapCache.get(id);
    }

    public setMap(id: string, map: L.Map) {
        this.mapCache.set(id, map);
    }

    public hasMap(id: string): boolean {
        return this.mapCache.has(id);
    }

    public deleteMap(id: string): boolean {
        return this.mapCache.delete(id);
    }

}

result-matching ""

    No results matching ""