-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better geodesy handling #2345
Better geodesy handling #2345
Conversation
@tmcw with this pull, Leaflet.geodesy plugin can be considered obsolete (at least for rendering true circles). Approximating with ellipses is as accurate, and looks and performs better (2 arcs vs polygon with many points). |
I think real-world area calculations and lat/lng offsets are quite useful - would those also be pulled into L? |
@tmcw not sure, maybe it's better to leave such stuff in a plugin, along with many other possible functions (calculate accumulated distance of a polyline, perimeter of a polygon, generate polygon buffer from a polyline, etc.) |
I think there is a problem, somewhere, with L.Circle. If I add a circle with given latitude and longitude, and a marker with the same latitude and longitude, the circle is reversed symmetrically about the equator, but only if the radius of the circle has a high value. Plus the projection seems faulty, in this case. Maybe you could look at this example: http://map.volcanis.me/iss.html |
@reventl0v is there a use case for using circles of 20000km radius? |
@mourner Yes. For example to represent the area of the Earth lit by the Sun |
Wow, I haven't thought about that use case. Circle was meant for smaller values, as it's implemented as approximation of circles with ellipses. Check out https://github.com/mapbox/leaflet-geodesy |
CRS.Earth
which serves as a base for all Earth-based CRS (EPSG3857
etc.)Map
distance(latlng1, latlng2)
method that takes CRS into account and works with flat projectionsCircle
to work with flat projectionsEPSG:3857
projections.Circle
with an ellipse in Earth-based projectionsShould also fix #1465 #1442.