Map not respecting that the earth is round
See original GitHub issueLongitude gets increased infinitely when map is moved to the east (and decreased infinitely moving to the west)
Steps o Reproduce
- Go to OL example at https://openlayers.org/en/latest/examples/geographic.html
- Remember the lat/lon coordinates written on the screen
- Move ‘around the world’ to the east until you come roughly to the same spot (easier to do if you zoom out)
- The new coordinates should be roughly the same as the ones in point 2., but that’s not the case for longitude - it was increased by one earth roundtrip (360deg).
This behaviour occurs also when you calculate the lat/lon coordinates from view extent, for example in moveend
event:
map.on('moveend', function(evt) {
var extentLatLonCoords =
transformExtent(evt.frameState.extent, evt.map.getView().getProjection(), 'EPSG:4326');
})
Expected behavior If you go ‘around the world’ and arrive at the same spot the calculated coordinates/extent should be the same and respect the fact that the earth is round 😄
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Why is the world map you know wrong?
"Every world map is distorted in some respect," Matthew Edney, a professor of ... our home planet is not flat — it is...
Read more >The Most Accurate Flat Map of Earth Yet
No flat map of the Earth can be perfect. But flat maps are ... Our map is actually more like the globe in...
Read more >The World is Round, Your Map is Not
Learn why all maps are a compromise between accuracy and usability, ... is no way around it—a flat map can't ever represent the...
Read more >Why your mental map of the world is wrong
There are lots of possible reasons for geographical misconceptions like this one, says cartographer John Nelson. Mental maps are necessarily ...
Read more >What are Map Projections? (And Why They Are Deceiving ...
The best way to represent the Earth is with a globe. ... it's hard to measure distances and they're just not as convenient...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There is an internal (non-API) method https://github.com/openlayers/openlayers/blob/master/src/ol/coordinate.js#L412
as
toLonLat()
solves my issue, I’m fine with closing this just one more question -toLonLat
unwraps coordinates for EPSG:4326 projection, but is there a build in way to unwrap other projections?