You are here

Feature update (v4.6): Wrapping over Longitude -180 / 180

As I already expected, someone will notice that I didn't care about longitude -180/180. Recently, User "InsertUser" reported on Github that OpenStreetBrowser stops working, if you wrap over the antimeridian.

Solving this issue was quite tricky. I can report, that everything should work now.

First I had to understand how Leaflet, OpenStreetMap and Overpass API handle wrapping over lon -180/180:

  • Leaflet will wrap the background images when going over lon -180/180, but it won't show vector features. They have to be placed at the wrapped coordinate (e.g. lon -220).
  • OpenStreetMap does not care about lon -180/180. Objects which stretch over -180/180 have to be split into two objects (combined via a multipolygon relation): the Western-most part and the Eastern-most part. Example.
  • Overpass API won't return ways and relations when querying bounding boxes stretching over lon -180/180. These queries have to be split into two requests.

If you find any problems are want to leave other comments, please use the Github issue page!