Methods and Events in JavaScript Maps

12 Jul 20226 minutes to read

Method for navigating to specific shape based on latitude, longitude and zoom level, you can use navigateTo method.

  • JS
  • //navigateTo method for map
       $("#container").ejMap("navigateTo", latitude, longitude, level);

    pan(direction)

    Method to perform map panning, you can use pan method.

  • JS
  • //pan method for map
       $("#container").ejMap("pan", direction);

    refresh()

    Method to reload the map, you can use refresh method.

  • JS
  • //refresh method for map
       $("#container").ejMap("refresh");

    refreshLayers()

    Method to reload the shapeLayers with updated values, you can use refreshLayers method.

  • JS
  • //refresh layers method for map
       $("#container").ejMap("refreshLayers");

    refreshNavigationControl(navigation)

    Method to reload the navigation control with updated values, you can use refreshNavigationControl method.

  • JS
  • //Refresh navigation control method for map
       $("#container").ejMap("refreshNavigationControl",navigation);

    zoom(level, isAnimate)

    Method to perform map zooming, you can use zoom method.

  • JS
  • //zoom method for map
       $("#container").ejMap("zoom",level,isAnimate);

    Events

    markerSelected

    Triggered on selecting the map markers, you can use markerSelected event.

  • JS
  • //markerSelected event for map
      
      $("#container").ejMap({
       markerSelected: function (event) {}
      });

    mouseleave

    Triggers while leaving the hovered map shape, you can use mouseleave event.

  • JS
  • //mouseleave  event for map
      $("#container").ejMap({
       mouseleave : function (event) {}
      });

    mouseover

    Triggers while hovering the map shape, you can use mouseover event.

  • JS
  • //mouseover  event for map
      $("#container").ejMap({
       mouseover : function (event) {}
      });

    onRenderComplete

    Triggers once map render completed, you can use onRenderComplete event.

  • JS
  • //onRenderComplete event for map
      $("#container").ejMap({
       onRenderComplete: function () {}
      });

    panned

    Triggers when map panning ends, you can use panned event.

  • JS
  • //panned event for map
      $("#container").ejMap({
       panned: function (event) {}
      });

    shapeSelected

    Triggered on selecting the map shapes, you can use shapeSelected event.

  • JS
  • //shapeSelected event for map
      $("#container").ejMap({
       shapeSelected: function (event) {}
      });

    zoomedIn

    Triggered when map is zoomed-in, you can use zoomedIn event.

  • JS
  • //zoomedIn event for map
      $("#container").ejMap({
       zoomedIn: function (event) {}
      });

    zoomedOut

    Triggers when map is zoomed out, you can use zoomedOut event.

  • JS
  • //zoomedOut event for map
      $("#container").ejMap({
       zoomedOut: function () {}
      });

    shapeRendering

    The shapeRendering event is triggered while rendering each shape in the map.

  • JS
  • //shapeRendering event for map
      $("#container").ejMap({
       shapeRendering : function (event) {}
      });

    bubbleRendering

    The bubbleRendering event is triggered while rendering each bubble in the map.

  • JS
  • //bubbleRendering event for map
      $("#container").ejMap({
       bubbleRendering : function (event) {}
      });

    legendItemRendering

    The legendItemRendering event is triggered before rendering each legend in the map.

  • JS
  • //legendItemRendering event for map
      $("#container").ejMap({
       legendItemRendering : function (event) {}
      });

    Click

    Triggers while clicking on the layers of the map, you can use click event.

  • JS
  • //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.

  • JS
  • //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.

  • JS
  • //RightClick event for map
    
    $("#container").ejMap({
        rightClick: function (args) {
                  //Do something
        }
       
    });

    onLoad

    Triggers before loading the map, you can use onLoad event.

  • JS
  • //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.

  • JS
  • //The displayTextRendering event for maps
    
    $("#container").ejMap({
    
        displayTextRendering: function (args) {
                 //Do something
        }
    	
    });

    Copyright © 2001 - 2015 Syncfusion Inc. All Rights Reserved