henrythasler / Leaflet.Geodesic

Add-on to draw geodesic lines with leaflet
GNU General Public License v3.0
156 stars 27 forks source link

Filling a circle #35

Closed samipuro closed 4 years ago

samipuro commented 6 years ago

[enhancement request]

Hi,

This plugin is really helpful for us, but one crucial feature is missing.. Or then I am just missing how to use it ;)

Namely the ability to fill a geodesic circle with a certain/defined color, in a similar manner like a normal circle can be filled in Leaflet's normal circle function (opacity and color for the fill).

henrythasler commented 6 years ago

That sounds like a good idea. I will have a look what needs to be modified.

henrythasler commented 6 years ago

LOL. No changes needed at all because it is already supported: just set fill: true

var Geodesic3 = L.geodesic([], {
    weight:3,
    opacity:1,
    fill: true,
    color: 'green',
    steps: 40
}).addTo(map);

Geodesic3.createCircle(calgary, 2000000);

I will add this info to the readme and the examples.

samipuro commented 6 years ago

Thanks for the info, appreciated. Filling works fine now.

However it still struggles to draw it correctly for a very large radius circle, attached an example with a 4300 nautical mile (8000km) circle centered at Atlanta airport clipboard01

henrythasler commented 6 years ago

I'm not sure what can be done about that. Let me think for a while.

GabrielSampol commented 6 years ago

When dragging or zooming the map up to the point that the lower part of the circle (southmost latitude) gets outside of the map boundaries, then the filling of the circle doesn't work as expected. Attached two examples. geodesic_circle1 geodesic_circle2

jziggas commented 5 years ago

Yeah I am seeing the same issue as @GabrielSampol when making large circles.

In addition to the unfilled "triangles" I am seeing I am seeing some unfilled "boxes" when using a circles when zooming in at certain levels. I am also using leaflet.markercluster to display marker clusters.

image

henrythasler commented 4 years ago

I will address this issue during refactoring (#40) that is currently in progress.

henrythasler commented 4 years ago

This is fixed with v2.1.0+.

jziggas commented 4 years ago

Terrific news, thanks @henrythasler !

jziggas commented 4 years ago

Ah, I am realizing we were using the ES5 branch but the recent changes are only applied to master. Is there any plan to update the ES5 branch at this point?

henrythasler commented 4 years ago

The toolchain creates distributions in the following formats: