Annotation Drawing Events
AnnotationDrawingStarted
Description
The AnnotationDrawingStarted
event is triggered when a user begins drawing an annotation on a Dashboard
or Record Level
Maptaskr Map. This event provides information about the annotation's shape name and starting latitude and longitude coordinates.
Usage
To listen for the AnnotationDrawingStarted
event, you can use the on
method of the window.top['maptaskrCORE']
object. This allows you to register an event listener that executes a call-back function when the event is triggered.
Example
window.top['maptaskrCORE'][controlId].on("AnnotationDrawingStarted", function(shapeName, startLat, startLng) {
console.log("shapeName: " + shapeName);
console.log("startLat: " + startLat);
console.log("startLng: " + startLng);
});
In the example above, we've registered an event listener for the AnnotationDrawingStarted
event. When the event occurs, the provided call-back function is executed, logging the annotation's shape name, starting latitude, and starting longitude to the console.
Parameters
shapeName
(string): The type or category of the annotation being drawn.startLat
(number): The latitude coordinate where the annotation drawing started.startLng
(number): The longitude coordinate where the annotation drawing started.
Removing Event Listeners
To remove the event listener for the AnnotationDrawingStarted
event, you can use the off
method of the window.top['maptaskrCORE']
object. This is useful when you no longer want to listen to this specific event.