layerDefaults.shape.style.fill Object
The default fill for layer shapes. Accepts a valid CSS color string or object with detailed configuration.
Example - Set default fill for all shape layers
<div id="map"></div>
<script>
$("#map").kendoMap({
layerDefaults: {
shape: {
style: {
fill: {
color: "red",
opacity: 1
}
}
}
},
layers: [{
type: "shape",
dataSource: {
type: "geojson",
data: [{
"type": "Polygon",
"coordinates": [
[[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
]
}]
}
}]
});
</script>
layerDefaults.shape.style.fill.color String
The default fill color for layer shapes. Accepts a valid CSS color string, including hex and rgb.
Example - Set default fill color for all shape layers
<div id="map"></div>
<script>
$("#map").kendoMap({
layerDefaults: {
shape: {
style: {
fill: {
color: "red"
}
}
}
},
layers: [{
type: "shape",
dataSource: {
type: "geojson",
data: [{
"type": "Polygon",
"coordinates": [
[[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
]
}]
}
}]
});
</script>
layerDefaults.shape.style.fill.opacity Number
The default fill opacity (0 to 1) for layer shapes.
Example - Set default fill with opacity for all shape layers
<div id="map"></div>
<script>
$("#map").kendoMap({
layerDefaults: {
shape: {
style: {
fill: {
color: "red",
opacity: 1
}
}
}
},
layers: [{
type: "shape",
dataSource: {
type: "geojson",
data: [{
"type": "Polygon",
"coordinates": [
[[30, 10], [40, 40], [20, 40], [10, 20], [30, 10]]
]
}]
}
}]
});
</script>