layerToLocation

Transforms layer (projected) coordinates to geographical location.

Parameters

point Array|kendo.geometry.Point

The layer (projected) coordinates. An array argument is assumed to be in x, y order.

zoom Number

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

Returns

kendo.dataviz.map.Location The geographic location that corresponds to the layer coordinates.

Example - retrieve location of NW corner (Array)

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

    var map = $("#map").data("kendoMap");
    var loc = map.layerToLocation([0, 0]).round();
/* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(loc.toString());
    // -180.000000,85.000000
</script>

Example - retrieve location of NW corner (kendo.geometry.Point)

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

    var map = $("#map").data("kendoMap");
    var point = new kendo.geometry.Point(0, 0);
    var loc = map.layerToLocation(point).round();
/* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(loc.toString());
    // -180.000000,85.000000
</script>
In this article