Maps SDK for Web
tt.IncidentMarker
The IncidentMarker class is used to display incident markers on the map. Clustered incidents are shown as a number and all the other incidents are shown with their appropriate category icon.
The structure of the marker is very simple:
There are 3 ways of customizing the marker:
- You can do some basic customization such as size and opacity in the options.
- Pass CSS classes to the outer and inner containers.
- Use the customElementCallback to pass a function that renders a complete custom HTML element.
Constructor
tt.IncidentMarker([options], [renderData])
Parameters
Name | Description |
---|---|
options
Object default:None |
Marker options |
options.imperialUnits
Boolean default: false |
Set units to imperial. |
options.offset
Array default: [0, 0] |
Marker offset - Negative offsets indicate left and up. |
options.popupOffset
Number | Array default: 15 |
Popup offset. Single number, vertical distance from the point or Array. Negative offsets indicate left and up. |
options.showDefaultPopup
Boolean default: true |
Shows default popup. |
options.size
Number default: 20 |
Width and height of the marker. |
options.opacity
Number default: 0.9 |
Opacity of the marker. |
options.outerClass
String default:None |
Add an extra CSS class to the outer element of the marker. |
options.innerClass
String default:None |
Add an extra CSS class to the inner element of the marker. |
options.customElementCallback
Function default:None |
A callback function to render a custom element for the marker.
In the callback you have access to all the features provided by the service customElementCallback(feature) .
This function must return a HTML element.
|
renderData
Object default:None |
Incident Details feature: This is data provided by the service to render the marker. |
renderData.geometry.coordinates
Array default:None |
The marker center point (lng lat). |
renderData.properties.incidentCategory
String default:None |
The category of the incident. |
renderData.properties.incidentSeverity
String default:None |
The severity of the incident. |
renderData.properties.clusterSize
String default:None |
The number of elements in the cluster. |