How do I compensate for ol.style.Circle or ol.style.RegularShape?
You can define the offset for the copies ol.style.Text
( offsetX
and offsetY
), and define a custom anchor for copies ol.style.Icon
. This functionality is missing in ol.style.Circle
neither ol.style.RegularShape
.
I need to draw my functions as four shapes (triangles, circles, ...) with appropriate offsets so that they do not overlap and appear completely.
eg. x
- the true coordinate of the feature, and four O
- four circles of different colors. Each one represents an attribute value and I need to color them dynamically based on the value.
O O
x
O O
What's the best way to implement offsets? Is it possible to extend existing prototypes in some future way? Or should I write my own style from scratch (I would like to use existing OL-3 code as much as possible)? Or is it better to use four ol.style.Icon
with different anchors?
source to share
The most promising way would be to facilitate this enhancement to OpenLayers. This should be fairly easy to implement - the option anchor
can be presented more or less in the same way as it is done in ol.style.Icon
.
To get started with OpenLayers 3, I would recommend reading https://github.com/openlayers/ol3/blob/master/CONTRIBUTING.md .
source to share