You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug MapLibreMap.visibleRegion.latLngBounds in certain circumstances returns a LatLngBounds with an invalid longitude (e.g. longitude=422.6005507684057).
Related crash report:
java.lang.IllegalArgumentException: Latitude 89.99986064045117, longitude 422.6005507684057 is not a valid position
at de.westnordost.streetcomplete.data.osm.mapdata.LatLon$Companion.checkValidity(Unknown Source:73)
at de.westnordost.streetcomplete.data.osm.mapdata.LatLon.<init>(SourceFile:0)
at de.westnordost.streetcomplete.data.osm.mapdata.BoundingBox.<init>(SourceFile:0)
at de.westnordost.streetcomplete.screens.main.map.maplibre.PositionKt.toBoundingBox(Unknown Source:16)
at de.westnordost.streetcomplete.screens.main.map.maplibre.PositionKt.screenAreaToBoundingBox(Unknown Source:16)
at de.westnordost.streetcomplete.screens.main.map.MapFragment.getDisplayedArea(Unknown Source:4)
To Reproduce
Move the screen to overlap with the 180th meridian. Observe the result of VisibleRegion.latLngBounds.
Maybe there are other ways to reproduce this, too.
Expected behavior LatLngBounds should always contain valid latitude and longitude coordinates.
Platform information:
Android
Maplibre v11.5.1
Additional context
Every VisibleRegion (= trapezoid of four LatLng coordinates at screen borders) has a LatLngBounds (= aligned rectangle of LatLng coordinates). A documentation comment states
since 7.0.0 LatLngBounds cannot be wrapped any more, i.e longitudeWest has to be less or equal to longitudeEast.
Fair enough, but then, what is the latLngBounds of a VisibleRegion at the 180th meridian? Looks to me that it should be two LatLngBounds in that case - one on the left and one on the right side of the 180th meridian.
In any case, currently, that documentation comment seems to be wrong anyway.
The text was updated successfully, but these errors were encountered:
Describe the bug
MapLibreMap.visibleRegion.latLngBounds
in certain circumstances returns aLatLngBounds
with an invalid longitude (e.g.longitude=422.6005507684057
).Related crash report:
(
MapFragment.getDisplayedArea()
callsmapLibreMap.projection.getVisibleRegion(true).latLngBounds
)To Reproduce
Move the screen to overlap with the 180th meridian. Observe the result of
VisibleRegion.latLngBounds
.Maybe there are other ways to reproduce this, too.
Expected behavior
LatLngBounds
should always contain valid latitude and longitude coordinates.Platform information:
Additional context
Every
VisibleRegion
(= trapezoid of four LatLng coordinates at screen borders) has aLatLngBounds
(= aligned rectangle of LatLng coordinates). A documentation comment statesFair enough, but then, what is the
latLngBounds
of aVisibleRegion
at the 180th meridian? Looks to me that it should be twoLatLngBounds
in that case - one on the left and one on the right side of the 180th meridian.In any case, currently, that documentation comment seems to be wrong anyway.
The text was updated successfully, but these errors were encountered: