Edit this page

layers.extent Array |kendo.dataviz.map.Extent

Specifies the extent of the region covered by this layer. The layer will be hidden when the specified area is out of view.

Accepts a four-element array that specifies the extent covered by this layer: North-West lat, longitude, South-East latitude, longitude.

If not specified, the layer is always visible.

Example - activate shape layer for given region

<div id="map"></div>
<script>
    $("#map").kendoMap({
        center: [42.6908, 23.3090],
        zoom: 12,
        layers: [{
            type: "tile",
            urlTemplate: "http://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            subdomains: ["a", "b", "c"]
        }, {
            extent: [
                43.4350, 22.2556,
                42.2265, 27.4850
            ],
            minZoom: 11,
            type: "shape",
            style: {
                fill: {
                    opacity: 0
                },
                stroke: {
                    color: "green",
                    width: 4
                }
            },
            dataSource: {
                type: "geojson",
                data: [{
                    "type": "Polygon",
                    "coordinates": [[
                        [ 23.3569, 42.6198 ],
                        [ 23.2360, 42.6743 ],
                        [ 23.2278, 42.7288 ],
                        [ 23.2666, 42.7505 ],
                        [ 23.3095, 42.7457 ],
                        [ 23.4046, 42.7089 ],
                        [ 23.4183, 42.6743 ],
                        [ 23.4204, 42.6299 ],
                        [ 23.3569, 42.6198 ]
                    ]]
                }]
            }
        }]
    });
</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