click
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
Example - place marker on clicked location
<div id="map"></div>
<script>
$("#map").kendoMap({
zoom: 3,
center: [0, 0],
layers: [{
type: "tile",
urlTemplate: "http://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
attribution: "© OpenStreetMap"
}],
click: function(e) {
e.sender.markers.add({
location: e.location,
tooltip: {
content: "Foo"
}
});
}
});
</script>
Example - subscribe to the click event after initialization
<div id="map"></div>
<script>
$("#map").kendoMap({
zoom: 3,
center: [0, 0],
layers: [{
type: "tile",
urlTemplate: "http://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
attribution: "© 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>