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 problem #19

Closed tecnocoma75 closed 7 years ago

tecnocoma75 commented 7 years ago

It seems that if you try to draw a full circle with setdirection .setDirection(0, 360) the result is a line and not a circle. Of course i can use startAngle: 0, stopAngle: 360 and result is a circle. Is it possible to solve the problem? Tha fact is that i'm trying to load a set of point in a a geojson with variuos radius, angles and azimut, and because of the bug, it's not possible to use a single function to draw everything (arcles, semicircles and full circles). This is the function used

var LinksLayer = L.geoJson(null, { pointToLayer: function (feature, latlng) {

                    return L.circle(latlng, {
                            radius: feature.geometry.radius,
                            fill: true,
                            fillColor:'#0080ff',
                            fillOpacity: 0.5,
                            color: '#000',
                            opacity: 0.5,
                            startAngle: feature.properties.azi-feature.properties.angle/2,
                            stopAngle: feature.properties.azi+feature.properties.angle/2
                        });
                }, ......

I also tried to use setdirection, but the problem is the same...if you you draw a circle, and pass angle=360 and azi=0, the result is a vertical line. Ok you can pass 359.9999...but in this way you have a circle with a line inside...and it's not good. Thank you very much for your support.

jieter commented 7 years ago

Released leaflet-semicircle@2.0.0, you now need to use L.semiCircle explicitly, so L.Circle is not changed.