Hello,
Locating and updating related shapes is possible, but we need to keep track of the shapes ourselves.
The shape reference that we get shapeCreated in remains "live" until the next map reset.
We can do the following:
var shapesById = {};
function onShapeCreated(e) {
var id = e.shape.dataItem.id;
shapesById[id] = shapesById[id] || [];
shapesById[id].push(e.shape);
}
function onReset() {
shapesById = {};
}
Then we can get the id from the shape in the shapeMouse* events:
function toggleShape(e) {
var id = e.shape.dataItem.id;
var shapes = shapesById[id];
...
}
I demonstrated this in the
following snippets. I hope this helps.
Regards,
T. Tsonev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework -
download Kendo UI now!