Edit this page

viewSize

Retrieves the size of the visible portion of the map.

Returns

Object The size (width and height) of the visible portion of the map.

Example - retrieve view size

<script>
    $("#map").kendoMap({
        zoom: 1, // Layer size is 512px (2^1 * 256)
        layers: [{
            type: "tile",
            urlTemplate: "http://a.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            attribution: "&copy; OpenStreetMap"
        }]
    });

    var map = $("#map").data("kendoMap");
    var viewSize = map.viewSize();
    console.log(viewSize);
    // { width: 1024, height: 512 }
</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