iotmapmanager
Version:
Manage markers, clusters, user marker or paths on IotMaps
44 lines (43 loc) • 2.43 kB
TypeScript
import * as L from 'leaflet';
import { IotCluster, IotMarker, IotUserMarker, PathIconType } from './iot-map-types';
import { IotMapConfig } from './iot-map-config';
/**
* Returns a DivIcon compatible with leaflet, representing all marker information (shape, tab, popup, size...)
*
* @param marker - an IotMarker structure containing all visual information
* @param config - config to use to generate the icon
* @param selected - true if marker must have selected design, false otherwise. (false by default)
* @returns a DivIcon containing design
*/
export declare function getMarkerIcon(marker: IotMarker, config: IotMapConfig, selected?: boolean): L.DivIcon;
/**
* Returns a DivIcon compatible with leaflet, representing all manual cluster information (shape, tab, popup, gauge...)
*
* @param cluster - an IotCluster structure containing all visual information
* @param config - config to use to generate the icon
* @param selected - true if cluster must have selected design, false otherwise. (false by default)
* @param automatic - true if clustering is automatic (calculated by leaflet), false if clustering is manual
*
* @remarks use this function for manual clustering purpose
*/
export declare function getManualClusterIcon(cluster: IotCluster, config: IotMapConfig): L.DivIcon;
/**
* Returns a DivIcon compatible with leaflet, representing all automatic cluster information (shape, tab, popup, gauge...)
* @param leafletCluster - cluster computed by leaflet
* @param config - config to use to display cluster
*
* @remarks use this function for automatic clustering purpose
*/
export declare function getAutomaticClusterIcon(leafletCluster: L.MarkerCluster, config: IotMapConfig): L.DivIcon;
/**
* Returns a DivIcon compatible with leaflet, representing all user marker information (direction, accuracy...)
* @param userMarker - IotUserMarker structure containing all visual information
* @param config - IotMapConfig configuration containing predefined and user defined values
*/
export declare function getUserMarkerIcon(userMarker: IotUserMarker, config: IotMapConfig): L.DivIcon;
/**
* Returns a DivIcon compatible with leaflet, representing a start, end or intermediate path icon
* @param type - PathIconType = start, end or mid
* @param config - config to use to display start / end / mid icons
*/
export declare function getPathIcon(type: PathIconType, config: IotMapConfig): L.DivIcon;