iotmapmanager
Version:
Manage markers, clusters, user marker or paths on IotMaps
67 lines (66 loc) • 2.27 kB
TypeScript
import { IotMapConfig } from './iot-map-config';
import { IotMapManager } from './iot-map-manager';
import { IotMarker } from './iot-map-types';
import { IotMapMarker } from './iot-map-marker';
export declare class IotMapMarkerManager {
markersObjects: IotMapMarker[];
accuracyObjects: any;
config: IotMapConfig;
map: IotMapManager;
constructor(map: IotMapManager, config: IotMapConfig);
/**
* Insert marker in the map
*
* @param marker - an IotMarker containing all display info
*/
addMarker(marker: IotMarker): void;
/**
* Insert a list of markers in the map
*
* @param markerList - list of IotMarker containing all display info for each marker
*/
addMarkers(markerList: IotMarker[]): void;
/**
* Remove a marker from the map
*
* @param markerId - the id of the marker to remove
*/
removeMarker(markerId: string): void;
/**
* Remove a list of markers from the map
*
* @param markersId - the id list of markers to remove
*/
removeMarkers(markersId: string[]): void;
/**
* Update a marker with new display parameters
*
* @param markersId - the id of the marker to update
* @param params - a structure containing partial display information to update
*/
updateMarker(markerId: string, params: Partial<IotMarker>): void;
/**
* Update all markers with new display parameters
*
* @param markerList - the list of markers to display
* @remarks the marker list is exhaustive: if a marker is not previously displayed but appears in markerList, it will
* be added / if a marker is previously displayed but doesn't appear in markerList, it will be removed / if a marker
* is previously displayed and appears in markerList, it will be updated
*/
updateAllMarkers(markerList: IotMarker[]): void;
/**
* Returns a leaflet element defined by its id
* @param id - Id of the element to return
*
* @remarks id is unique
*/
getMarker(id: string): IotMapMarker;
/**
* Returns all leaflet elements (markers and clusters)
*/
getAllMarkers(): IotMapMarker[];
/**
* Force all markers to redraw
*/
redrawAll(): void;
}