LayerDefaults.shape
configurationThe default configuration for shape layers.
layerDefaults.shape
Object<div id="map"></div>
<script>
$("#map").kendoMap({
layerDefaults: {
shape: {
attribution: "© 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: "© 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>
Related Members
- layerDefaults.shape.style - The default style for shapes.