Edit this page

setDataSource

Sets the data source of this layer.

Example - Set shape layer data source

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layers: [{
            type: "shape"
        }]
    });

    var ds = new kendo.data.DataSource({
        type: "geojson",
        data: [{
            "type": "Polygon",
            "coordinates": [
                [[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
            ]
        }]
    });

    var map = $("#map").data("kendoMap");
    var layer = map.layers[0];
    layer.setDataSource(ds);
</script>

Parameters##### dataSource Object

A live DataSource instance or its configuration object.

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy