Skip to content
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

Merged
merged 16 commits into from
Jan 3, 2014
Merged

Better geodesy handling #2345

merged 16 commits into from
Jan 3, 2014

Conversation

mourner
Copy link
Member

@mourner mourner commented Jan 2, 2014

  • Add CRS.Earth which serves as a base for all Earth-based CRS (EPSG3857 etc.)
  • Add Map distance(latlng1, latlng2) method that takes CRS into account and works with flat projections
  • Fix Circle to work with flat projections
  • Fix scale control precision in non-EPSG:3857 projections.
  • Add low-level ellipse rendering support
  • Approximate Circle with an ellipse in Earth-based projections
  • Fix clamped circle rendering near poles
  • Fix Canvas circles not clearing when updating LatLng

Should also fix #1465 #1442.

@mourner mourner mentioned this pull request Jan 2, 2014
@ghost ghost assigned mourner Jan 2, 2014
@mourner
Copy link
Member Author

mourner commented Jan 3, 2014

@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).

mourner added a commit that referenced this pull request Jan 3, 2014
@mourner mourner merged commit b01126d into master Jan 3, 2014
@mourner mourner deleted the geodesic branch January 3, 2014 16:13
@tmcw
Copy link
Contributor

tmcw commented Jan 3, 2014

I think real-world area calculations and lat/lng offsets are quite useful - would those also be pulled into L?

@mourner
Copy link
Member Author

mourner commented Jan 3, 2014

@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.)

@ghost
Copy link

ghost commented Jan 4, 2014

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

@mourner
Copy link
Member Author

mourner commented Jan 5, 2014

@reventl0v is there a use case for using circles of 20000km radius?

@ghost
Copy link

ghost commented Jan 5, 2014

@mourner Yes. For example to represent the area of the Earth lit by the Sun

@mourner
Copy link
Member Author

mourner commented Jan 5, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wrong Circle radius in L.Circle + CRS.Simple combination
3 participants