Methods and Events in JavaScript Maps
12 Jul 20226 minutes to read
navigateTo(latitude, longitude, level)
Method for navigating to specific shape based on latitude, longitude and zoom level, you can use navigateTo method.
//navigateTo method for map
$("#container").ejMap("navigateTo", latitude, longitude, level);pan(direction)
Method to perform map panning, you can use pan method.
//pan method for map
$("#container").ejMap("pan", direction);refresh()
Method to reload the map, you can use refresh method.
//refresh method for map
$("#container").ejMap("refresh");refreshLayers()
Method to reload the shapeLayers with updated values, you can use refreshLayers method.
//refresh layers method for map
$("#container").ejMap("refreshLayers");refreshNavigationControl(navigation)
Method to reload the navigation control with updated values, you can use refreshNavigationControl method.
//Refresh navigation control method for map
$("#container").ejMap("refreshNavigationControl",navigation);zoom(level, isAnimate)
Method to perform map zooming, you can use zoom method.
//zoom method for map
$("#container").ejMap("zoom",level,isAnimate);Events
markerSelected
Triggered on selecting the map markers, you can use markerSelected event.
//markerSelected event for map
$("#container").ejMap({
markerSelected: function (event) {}
});mouseleave
Triggers while leaving the hovered map shape, you can use mouseleave event.
//mouseleave event for map
$("#container").ejMap({
mouseleave : function (event) {}
});mouseover
Triggers while hovering the map shape, you can use mouseover event.
//mouseover event for map
$("#container").ejMap({
mouseover : function (event) {}
});onRenderComplete
Triggers once map render completed, you can use onRenderComplete event.
//onRenderComplete event for map
$("#container").ejMap({
onRenderComplete: function () {}
});panned
Triggers when map panning ends, you can use panned event.
//panned event for map
$("#container").ejMap({
panned: function (event) {}
});shapeSelected
Triggered on selecting the map shapes, you can use shapeSelected event.
//shapeSelected event for map
$("#container").ejMap({
shapeSelected: function (event) {}
});zoomedIn
Triggered when map is zoomed-in, you can use zoomedIn event.
//zoomedIn event for map
$("#container").ejMap({
zoomedIn: function (event) {}
});zoomedOut
Triggers when map is zoomed out, you can use zoomedOut event.
//zoomedOut event for map
$("#container").ejMap({
zoomedOut: function () {}
});shapeRendering
The shapeRendering event is triggered while rendering each shape in the map.
//shapeRendering event for map
$("#container").ejMap({
shapeRendering : function (event) {}
});bubbleRendering
The bubbleRendering event is triggered while rendering each bubble in the map.
//bubbleRendering event for map
$("#container").ejMap({
bubbleRendering : function (event) {}
});legendItemRendering
The legendItemRendering event is triggered before rendering each legend in the map.
//legendItemRendering event for map
$("#container").ejMap({
legendItemRendering : function (event) {}
});Click
Triggers while clicking on the layers of the map, you can use click event.
//Click event for map
$("#container").ejMap({
click: function (args) {
//Do something
}
});doubleClick
Triggers while double clicking on the layers of the map, you can use doubleClick event.
//DoubleClick event for map.
$("#container").ejMap({
doubleClick: function (args) {
//Do something
}
});rightClick
Triggers while right clicking on the layers of the map, you can use rightClick event.
//RightClick event for map
$("#container").ejMap({
rightClick: function (args) {
//Do something
}
});onLoad
Triggers before loading the map, you can use onLoad event.
//onLoad event for map
$("#container").ejMap({
onLoad: function (args) {
//Do something
}
});displayTextRendering
The displayTextRendering event is triggered before rendering the data labels. You can use this event to customize the label text or change the text value.
//The displayTextRendering event for maps
$("#container").ejMap({
displayTextRendering: function (args) {
//Do something
}
});