New to Kendo UI for jQuery? Start a free 30-day trial

Click

events

Fired when the user clicks on the map.

Event Data

e.location kendo.dataviz.map.Location

The location of the clicked point.

e.sender kendo.dataviz.ui.Map

The source widget instance.

e.originalEvent Object

The source jQuery event instance

<div id="map"></div>
<script>
    $("#map").kendoMap({
        zoom: 3,
        center: [0, 0],
        layers: [{
            type: "tile",
            urlTemplate: "https://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            attribution: "&copy; OpenStreetMap"
        }],
        click: function(e) {
            e.sender.markers.add({
                location: e.location,
                tooltip: {
                    content: "Foo"
                }
            });
        }
    });
</script>
<div id="map"></div>
<script>
    $("#map").kendoMap({
        zoom: 3,
        center: [0, 0],
        layers: [{
            type: "tile",
            urlTemplate: "https://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            attribution: "&copy; OpenStreetMap"
        }]
    });

    var map = $("#map").data("kendoMap");
    map.bind("click", function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
        console.log("You clicked at " + e.location.toString());
    });
</script>
Not finding the help you need?
Contact Support