It is possible to define an offset for ol.style.Text
instances (offsetX
and offsetY
properties) and define a custom anchor for ol.style.Icon
instances. This functionality is not present neither in ol.style.Circle
nor ol.style.RegularShape
.
I need to draw my features as four shapes (triangles, circles, ...) with proper offsets so that they won't overlap and will be rendered completely.
E.g. x
is the true coordinate of a feature and the four O
s are four circles of different colors. Each represents a value of an attribute and I need to color them dynamically depending on the value.
O O
x
O O
What is the best way to implement offsets? Is it possible to extend existing prototypes in some future-proof way? Or should I write my own style from scratch (I'd like to reuse as much of existing OL-3 code as possible)? Or is it better to use four ol.style.Icon
s with different anchors?