jieter / Leaflet-semicircle

Extend Leaflet's circle class to display semicircles.
http://jieter.github.io/Leaflet-semicircle/examples/semicircle.html
MIT License
123 stars 52 forks source link

Full circle with semiCircle #21

Open tecnocoma75 opened 7 years ago

tecnocoma75 commented 7 years ago

Sorry for reopening the ticket...it seems like also v2.0.0.0 can't make full circle using setdirection mode, or ami i wrong? I modified your fullcircle demo and replaced code with:

L.semiCircle(latlng, { radius: radius, fill: true, fillColor:'#a1ba03', fillOpacity: 0.5, color: '#a1ba03', opacity: 0.5 }).setDirection(0,360).addTo(map);

The problem is the same: a vertical line.

jieter commented 7 years ago

Why are you not just calling L.circle(latlng, {...})?

You can improve this check: https://github.com/jieter/Leaflet-semicircle/blob/master/Semicircle.js to make L.semiCircle render a circle in your case, please open a PR.

tecnocoma75 commented 7 years ago

Ok i will use Circle. The problem is that i have to map various object (arc and circle)imported from Json, and so i needed a unique function to render both Circle and Arcs . If it's not possible i will use a IF-CONDITION on parameter DEGREE and for 360° use CIRCLE instead of Semicircle. Probably semicircle.js should be updated to handle a degree of 360..infact if i use a 359,999 value, the circle is good...but i don't like the solution...: will open a PR.