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

LayerDefaults.shape

configuration

The default configuration for shape layers.

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layerDefaults: {
            shape: {
                attribution: "&copy; Company Inc."
            }
        },
        layers: [{
            type: "shape",
            dataSource: {
                type: "geojson",
                data: [{
                    "type": "Polygon",
                    "coordinates": [
                        [[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
                    ]
                }]
            }
        }]
    });
</script>

The attribution for all shape layers.

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layerDefaults: {
            shape: {
                attribution: "&copy; Company Inc."
            }
        },
        layers: [{
            type: "shape",
            dataSource: {
                type: "geojson",
                data: [{
                    "type": "Polygon",
                    "coordinates": [
                        [[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
                    ]
                }]
            }
        }]
    });
</script>

The opacity of all shape layers.

Default: 1

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layerDefaults: {
            shape: {
                opacity: 0.5
            }
        },
        layers: [{
            type: "shape",
            dataSource: {
                type: "geojson",
                data: [{
                    "type": "Polygon",
                    "coordinates": [
                        [[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
                    ]
                }]
            }
        }]
    });
</script>

The default style for shapes.

<div id="map"></div>
<script>
    $("#map").kendoMap({
        layerDefaults: {
            shape: {
                style: {
                    fill: {
                        color: "red",
                        opacity: 1
                    },
                    stroke: {
                        color: "green",
                        width: 4,
                        dashType: "longDashDot",
                        opacity: 0.5
                    }
                }
            }
        },
        layers: [{
            type: "shape",
            dataSource: {
                type: "geojson",
                data: [{
                    "type": "Polygon",
                    "coordinates": [
                        [[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
                    ]
                }]
            }
        }]
    });
</script>