SD Maps Event

Event Manager
Events in the SD Maps API are handled by using utility functions within the EventManager to register event listeners. To register for notification of these events, use the static method EventManager.add (). That method takes an object, an event to listen for, and a function to call when the specified event occurs. See Map Event Manager Reference for more information.

The event type than can be assign to SD Maps Event Manager are: Below is example to create SD Maps Event Manager.
var map = new SD.genmap.Map(document.getElementById("map"), { 

    center: new GeoPoint(103.80733282853, 1.289478890541), 
    
    zoom: 13 

});

EventManager.add(map, "click", function() {

    alert("You click the map");

});

Event related to viewport
Event Descrioption
OnEndDrag This event will be triggered if map is panned using mouse.
OnEndMove This event will be triggered if map is panned using directional control.
OnLevelChanged This event will be triggered if zoom level changes (by scroll and by zoom control click).
zoomIn Zoom in the map.
zoomOut Zoom out the map.

Below is example to use this event.
map.viewport.OnEndDrag.register(function() {

    // your function
    
});
EventManager.add(map, "click", function() {

    map.viewport.zoomIn();

});