Open jaakla opened 8 years ago
Should discuss it together with rest of CartoCSS extensions
Another use case for this would be in editable layer - click on a point (or another object), highlight it, then can add also context-sensitive button(s) next to the object like in ID OSM editor, or in corner of map view: delete, copy, edit details/attributes. For lines/polygons also individual vertex could be selected, so this way vertexes can be deleted.
A small sample how this use case can be achieved with existing extensions:
#layer {
line-width: 2;
}
#layer::active {
line-width: 4;
line-opacity: ([osm_id] = [nuti::selected_id] ? 0.5 : 0);
}
Add API to control state of selected elements in vector layers. SDK tracks object ID-s which are selected or not, and renders them accordingly. Methods like addSelectedObject() removeSelectedObject(), getSelectedObjects().
CartoCSS style decoder should enable to set different style for selected elements with special term
::active
(similar to ::hover)