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

Returns the geographical location that correspond to the view (relative) coordinates.

Parameters:pointArray|kendo.geometry.Point

The view coordinates. An array argument is assumed to be in x, y order.

zoomNumber

Optional. Assumed zoom level. Defaults to the current zoom level.

Returns:kendo.dataviz.map.Location

The geographic location that corresponds to the view coordinates.

<div id="map" style="width: 1024px; height: 1024px;"></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");
    var loc = map.viewToLocation([512, 512]).round();
/* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(loc.toString());
    // 0.000000,0.000000
</script>
<div id="map" style="width: 1024px; height: 1024px;"></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");
    var view = new kendo.geometry.Point(512, 512);
    var loc = map.viewToLocation(view).round();
/* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(loc.toString());
    // 0.000000,0.000000
</script>
Not finding the help you need?
Contact Support