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

onMapChanged() called repeatedly when enabling MyLocation #3207

Closed
mudar opened this issue Dec 7, 2015 · 5 comments
Closed

onMapChanged() called repeatedly when enabling MyLocation #3207

mudar opened this issue Dec 7, 2015 · 5 comments
Labels
Android Mapbox Maps SDK for Android

Comments

@mudar
Copy link

mudar commented Dec 7, 2015

Hi,

I have noticed that onMapChanged(int change) is called repeatedly (never stops) if you enable MyLocation.

vMap.setMyLocationEnabled(true);
vMap.setMyLocationTrackingMode(MyLocationTracking.TRACKING_NONE);

It gets about 100 calls per second, a sequence of WILL_START_RENDERING_FRAME followed by DID_FINISH_RENDERING_FRAME_FULLY_RENDERED. So that's 8,10,8,10...
And this happens when I'm not touching the screen. And the map is not updating because of the MyLocation blue dot, since onMyLocationChange(Location location) gets called at a very reasonable rate (3-4 calls at the beginning).

I'm using 2.4.0-SNAPSHOT, running on Nexus 6 (5.1.1). But my main issue is running the app on a Sony Xperia M4 Aqua (5.0), where the app crashes very frequently with Renderer issues.

OpenGLRenderer﹕ Path too large to be rendered into a texture
@mudar
Copy link
Author

mudar commented Dec 7, 2015

simplified log, with 2 long sequences of about 100 calls per second.
Edited: attached instead of inline.
log.txt

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Dec 7, 2015
@mudar
Copy link
Author

mudar commented Dec 7, 2015

One more note about onMapChanged(), the call sequence stops if you pan MyLocation out of the map (with its accuracy circle). If not, the sequence never stops.

I've been struggling for a while with the OpenGLRenderer crash issue on the Xperia M4, so the onMapChanged() issue is just my latest guess!

  • It doesn't crash on Nexus 6, HTC One Mini or Galaxy S3.
  • It doesn't crash without enabling MyLocation
  • Happens mainly when starting or resuming the app. If it doesn't crash at the beginning, it usually runs fine.
  • Regardless if GPS high accuracy is enabled or disabled.
  • I have also tried delaying setMyLocationEnabled(true) till after onMapChanged( DID_FINISH_LOADING_MAP ) but it still crashes
  • Could be related to the support design library, or a Sony issue (related to issue Crash on Android 5.1.1 #2978)
  • Could be related to missing arm64 lib (issue Missing arm64 lib #3128)

also attached is a debug_active output. Please let me know if I could help with any tests or additional information.
debug.txt

@mudar
Copy link
Author

mudar commented Dec 9, 2015

The onMapChanged() issue is very probably related to ticket #2049
I've replaced these lines

vMap.setMyLocationEnabled(true);
vMap.setMyLocationTrackingMode(MyLocationTracking.TRACKING_NONE);

by the following, to see if the issue is related to the comapss

vMap.setMyLocationEnabled(true);
vMap.setMyBearingTrackingMode(MyBearingTracking.COMPASS);

And there it was: the compass arrow keeps constantly spinning around. Mapbox doesn't seem to find MyBearing, while it looks ok in google maps (no calibration request). I then tried to explicitly disable the compass bearing

vMap.setMyBearingTrackingMode(MyBearingTracking.COMPASS);

but the calls to onMapChanged() keep coming.

Does this make any sense?

@tobrun
Copy link
Member

tobrun commented Dec 9, 2015

@mudar
Thank you reaching out and reporting these problems.

Too many updates:

The UserLocationView is a basic Android View versus our MapView which is GL based.
We need to keep both the View location and GL elements in sync, this will probably be the cause of these updates. Will have to look into it where this is happening and if we can optimise this.

Spinning UserLocationView:

I recently noticed the spinning, at the time of implementing this was not an issue.. will have to dive into the commit history to find out where that problem is coming from. Will create a separate issue for that.

@mudar
Copy link
Author

mudar commented Jan 4, 2016

Closing issue, seems fixed in version 3.1.0, with vMap.setMyBearingTrackingMode(MyBearingTracking.NONE)
thanks!

@mudar mudar closed this as completed Jan 4, 2016
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