Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[android] setOnCameraChangeListener() issues #8846

Closed
Petrulak opened this issue Apr 28, 2017 · 3 comments
Closed

[android] setOnCameraChangeListener() issues #8846

Petrulak opened this issue Apr 28, 2017 · 3 comments
Labels
Android Mapbox Maps SDK for Android

Comments

@Petrulak
Copy link

Hello there MapBox team!
First of all, thanks You for the great product!
Our Company recently decided to switch from GoogleMaps to MapBox.
Migration is going pretty smooth and straightforward. However we are facing one issue.
Our use case is that once user stops zooming, moving the camera we perform an Api Request which takes the currently visible region from the map and display some data.
The old way( google maps way) to implement this use case was to use OnCameraIdleListener which worked as expected.
Unfortunately map box Android SDK doesn't provide any similar method. Only method what we can use is OnCameraChangeListener .
The problem with this callback is that it sometimes returns the same value for a few seconds, even without touching/moving the map. So in case we would use this callback we are facing an issue ,that map is not being moved but callback is still triggered.

04-28 14:08:28.061 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.093 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.127 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.165 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.202 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.247 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.278 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.312 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.343 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.376 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.410 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.438 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.471 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.505 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.542 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.576 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.616 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.654 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.699 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.729 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.763 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.800 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.834 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.875 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.916 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:28.965 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:29.007 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:29.038 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:29.072 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:29.114 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404
04-28 14:08:29.147 Fragment$initial: N:52.52983708041455; E:13.40551142577715; S:52.52581634563617; W:13.401649044836404

Do You guys have some workaround or thoughts how to solve this issue ?
We are using com.mapbox.mapboxsdk:mapbox-android-sdk:5.0.2@aar
Thank You!

@tobrun tobrun added the Android Mapbox Maps SDK for Android label May 2, 2017
@tobrun
Copy link
Member

tobrun commented May 2, 2017

@Petrulak Thank you for the report! Luckily we are working on adding the requested OnCameraIdleChange listener methods in #8644 (originally defined in #6350). This feature is aimed to be released with the 5.1.0 release. I'm going to close this issue as the reported bug occurs on a to-be deprecated api. For work around, you could look into listening to specific gestures with eg. MapboxMap#setOnScrollChangeListener or hook into OnMapChange events with mapView#setOnMapChangeListener.

@tobrun tobrun closed this as completed May 2, 2017
@Petrulak
Copy link
Author

Petrulak commented May 2, 2017

@tobrun thank You!
Just a quick question, when are you guys aiming for 5.1.0 release ?

@tobrun
Copy link
Member

tobrun commented May 2, 2017

can't give definitive answer on a concrete date (our initial aim was somewhere in May),
The main feature (extrusions/3D buildings) has just landed on master and we will start doing beta builds this week.
For a final release we aim at having a couple of beta's to ensure stability.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

No branches or pull requests

2 participants