Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Cannot zoom to bounding box #1784

@ArnyminerZ

Description

@ArnyminerZ

Issue Type

  • [*] Bug

Description and/or steps/code to reproduce the problem

When trying to move the camera to the following bounding box:

N:38.703256; E:-0.48536999999999997; S:38.69581; W:-0.49455

This error occurs:

java.lang.IllegalArgumentException: north must be in [-85.05112877980658,85.05112877980658]
    at org.osmdroid.util.BoundingBox.set(BoundingBox.java:74)
    at org.osmdroid.views.Projection.refresh(Projection.java:699)
    at org.osmdroid.views.Projection.<init>(Projection.java:111)
    at org.osmdroid.views.Projection.<init>(Projection.java:123)
    at org.osmdroid.views.MapView.zoomToBoundingBox(MapView.java:564)
    at org.osmdroid.views.MapView.zoomToBoundingBox(MapView.java:590)

I'm calling it the following way:

val boundingBox = points.getBoundingBox()
mapView.zoomToBoundingBox(boundingBox, animate, 30)

Points is a list of GeoPoint:

[
    38.69601, -0.49455, 0.0,
    38.703256, -0.486723, 0.0
]

Which is extended here:

https://gist.github.com/ArnyminerZ/5ef0c46c4c3d42045005dd3459735aec#file-utils-kt-L31

Environment

If it's a bug, version(s) of android this affects:

All

Version of osmdroid the issue relates to:

6.1.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions