Balázs Eigner
Balázs Eigner

Reputation: 87

OL3 - draw circle arc

For v3.8.1 I had a solution for drawing not full circles, but circle arcs ("pies", using style, not by manipulating the feature geometry (!)) with the input of start and end angles (antenna directions with beam widths). It looks like this (3 features at the same point but different angles):

enter image description here

Unfortunately, I just hacked it into the ol.style.Circle.prototype.draw_ function in the source code. I've tried to move to v4.6.5, but the code changed so much, I was not able to adopt my modifications to it (yet).

The question is: is there any solution for this in the out-of-the box version of the library? I've tried to look at examples, but found nothing that helped me.

Thanks!

Upvotes: 0

Views: 2019

Answers (1)

Balázs Eigner
Balázs Eigner

Reputation: 87

I've got the solution. The clues are on the Earthquakes example. All you have to do, is draw a symbol you want on a canvas and use that for icon of the style. You don't even have to use OpenLayers functions, but only standard canvas methods, like this:

enter image description here

... and use the canvas for the icon as shown on the example.

Upvotes: 1

Related Questions