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

Returns the layer (projected) coordinates that correspond to a geographical location.

Parameters:locationArray|kendo.dataviz.map.Location

The geographic location. An array argument is assumed to be in [Latitude, Longitude] order.

zoomNumber

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

Returns:kendo.geometry.Point

The layer (projected) coordinates.

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

    var map = $("#map").data("kendoMap");
    var point = map.locationToLayer([0, 0]).round();
/* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(point.toString());
    // 256,256
</script>
<div id="map" style="width: 1024px; height: 1024px;"></div>
<script>
    $("#map").kendoMap({
        zoom: 1,
        layers: [{
            type: "tile",
            urlTemplate: "https://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            attribution: "&copy; OpenStreetMap"
        }]
    });

    var map = $("#map").data("kendoMap");
    var loc = new kendo.dataviz.map.Location(0, 0);
    var point = map.locationToLayer(loc).round();
/* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(point.toString());
    // 256,256
</script>
Not finding the help you need?
Contact Support