shapeCreated
Fired when a shape is created, but is not rendered yet.
Event Data
e.layer kendo.dataviz.map.layer.Shape
The parent layer instance.
e.shape kendo.drawing.Element
The shape instance.
e.sender kendo.dataviz.ui.Map
The source widget instance.
e.originalEvent Object
The source jQuery event instance
Example - bind to the map shapeCreated event on initialization
<div id="map"></div>
<script>
var data = [
{ "type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0],
[100.0, 1.0], [100.0, 0.0] ]
]
},
"properties": {
"name": "Feature #1"
}
}
];
$("#map").kendoMap({
center: [0.5, 100.5],
zoom: 8,
layers: [{
type: "shape",
dataSource: {
type: "geojson",
data: data
}
}],
shapeCreated: onShapeCreated
});
function onShapeCreated(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log("shape created: ", e.shape.dataItem.properties.name);
}
</script>