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

onMapChanged() called repeatedly when enabling MyLocation #3207

Closed

Description

@mudar

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

Activity

  1. mudar commented on Dec 7, 2015

    @mudar
    Author

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

  2. added
    Android
    on Dec 7, 2015
  3. mudar commented on Dec 7, 2015

    @mudar
    Author

    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

  4. mudar commented on Dec 9, 2015

    @mudar
    Author

    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?

  5. tobrun commented on Dec 9, 2015

    @tobrun
    Member

    @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.

  6. added a commit that references this issue on Dec 11, 2015
  7. mudar commented on Jan 4, 2016

    @mudar
    Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Android

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions