-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Feature request: Support for {lat, lon} objects in LngLat#convert #7090
Comments
Mapbox-gl-js: https://github.com/mapbox/mapbox-gl-js/blob/master/src/geo/lng_lat.js Would be nice to bring in the No point in opening another issue. The same should be considered for Leaflet: https://github.com/Leaflet/Leaflet/blob/master/src/geo/LatLngBounds.js |
@mourner @jfirebaugh before I make any changes, would a pull request adding support for this be considered? |
I think this makes sense. It's a fairly small addition that improves compatibility between GL JS and other libraries. As for the other methods mentioned: GL Native has a TLDR on my two cents: |
The only reason I mentioned
I'm guessing that was necessary since a lot of manipulations of I did not realize that the |
@bfrengley I'm happy to accept a pull request adding support for |
Fixed by #7507 |
Motivation
There are a number of JS libraries which deal with
{ lat: number; lon: number; }
types rather than mapbox-gl-js'{ lng: number; lat: number; }
. Currently interoperating between these and mapbox-gl-js is slightly painful, with conversions required in both directions. Other mapping libraries such as Leaflet support converting from{ lat: number; lon: number; }
already.Design
LngLat#convert
already supports converting from{ lng: number; lat: number }
objects which are not instances ofLngLat
. If nolng
is present ininput
, fall back tolon
instead.I am happy to make a pull request if this feature would be considered.
The text was updated successfully, but these errors were encountered: