Closed schachi5000 closed 4 years ago
@schachi5000 thank you for reaching out and reporting your issue. I'm not able to reproduce your issue as:
@NonNull
.Could you add a bit more context, or an example where the exception is only thrown in nativeGetCameraForLatLngBounds
?
Right. I've observed the same behavior you mentioned, while testing our code. So reproducing the issue locally was not possible. The stacktrace I've posted is something we get from our crash report system and sadly the only trace of the issue.
We are using getCameraForLatLngBounds
at only one location in our code and always with a LatLngBounds.Builder
.
Correct me if I'm wrong here, but the only way to call getCameraForLatLngBounds()
is with LatLngBounds
. LatLngBounds
can only be constructed with valid data, since it would throw IllegalArguementException
if any data would be wrong.
If all of the above is correct there might be error in nativeGetCameraForLatLngBounds
, since it should not be possible to pass a NaN
.
Thank you for following up, I'm as confused as your are atm :)
One thing worth mentioning: The error only started to appear after we've updated the SDK from v6.3.0
to v7.1.2
@tobrun - we have https://github.com/mapbox/mapbox-gl-native/issues/13938 on the iOS side, which may possibly be related - as it appears to be random. My first thought that it was invalid (non web-mercator) coordinates - and I continue to investigate that path - but those are likely to hit a CALayer exception.
Hi there. Just a short FYI. We've updated the SDK now to 7.3.2
but the error still persists.
Due to sheer luck I've stumbled about a way to recreate the error. The cause were the passed padding values. By using a few devices in landscape mode, the passed padding creates a rectangle too tight
to process properly.
So it wasn't the passed LatLngBounds
after all. Rather the calculated values by the method itself.
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.
Due to sheer luck I've stumbled about a way to recreate the error. The cause were the passed padding values. By using a few devices in landscape mode, the passed padding creates a rectangle too
tight
to process properly.So it wasn't the passed
LatLngBounds
after all. Rather the calculated values by the method itself.
Hi @schachi5000 I faced the same issue and I can't reproduce the exception. What did you do to stop this error? Can you give me the coordinates that produce the error?
In our app we arbitrarily receive the following error, when trying to move the camera to a location defined by a bounding box.
Expected behavior
CameraPosition
should be provided so the camera can be animated to the new location.Actual behavior
Crash due to
java.lang.Error
Configuration
A
LatLngBounds.Builder
is used to create theLatLngBounds
object.If the provided latitude oder longitude were
null
, the constructor/setter inLatLng
should have thrown the error. Instead it is thrown later inNativeMapView.nativeGetCameraForLatLngBounds()
Android versions: no specific version
Device models: no specific device Mapbox SDK versions: 7.1.2