Edit this page

eventToLocation

Retrieves the geographic location that correspond to this mouse event.

Parameters

e Object |jQuery.Event

The DOM or jQuery mouse event.

Returns

kendo.geometry.Point The geographic location that correspond to this mouse event.

Example - place marker on clicked location

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "tile",
            urlTemplate: "http://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            attribution: "&copy; OpenStreetMap"
        }]
    });

    var map = $("#map").data("kendoMap");
    $("#map").click(function(e) {
        var loc = map.eventToLocation(e);
        map.markers.add({
            location: loc,
            tooltip: {
                content: "Foo"
            }
        });
    });
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy