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.

Annotations not stable or disappear after loop #5019

Closed

Description

Platform: Samsung Note 3 - Android Lollipop 5.0
Mapbox SDK version: 4.1.0-SNAPSHOT

Steps to trigger behavior

  1. After we rebuild last update the MapBox SDK 4.1.0-SNAPSHOT, then the problem is occur.
  2. Marker or annotation not stable, sometimes it show or hide from map.

Expected behavior

Actual behavior

Activity

  1. tobrun commented on May 13, 2016

    @tobrun
    Member

    @zhemora could you verify it's the 4.1.0-SNAPSHOT dependency?
    The problem now is that there are multiple versions at this time:

    • 4.0.1-SNAPSHOT
    • 4.0.1
    • 4.1.0-SNAPSHOT (this one hasn't been build for a couple of days)

    And I need to be sure before looking into where the problem is originating from.

    I just kicked of a build for the 4.1.0-SNAPSHOT so it reflects the latest state of master.

  2. added
    Android
    on May 13, 2016
  3. added 2 commits that reference this issue on May 13, 2016
  4. tobrun commented on May 13, 2016

    @tobrun
    Member

    @zhemora
    To investigate this issue I created some sample code in 14e1207.
    The code adds/removes markers to/from a map constantly every 1500ms.

    ezgif com-video-to-gif 11

    Could you share some code how you are adding/removing these markers? or compare it with 14e1207? Could you try testing with the newer SNAPSHOT? (for this you need to invalidate gradle caches and do a gradle sync)

  5. tobrun commented on May 13, 2016

    @tobrun
    Member

    @zhemora thank you for adding that information. Will try to reproduce.

  6. tobrun commented on May 17, 2016

    @tobrun
    Member

    @zhemora thank you for adding the code and GIF demonstrating the issue.
    Going to reproduce locally and debug why the markers aren't reloaded.

  7. tobrun commented on May 17, 2016

    @tobrun
    Member

    No problems doing a couple of iterations -> 2399 id marker
    device-2016-05-17-110341

    Next iteration I'm seeing some markers not being added to the map -> 2999 id latest maker

    device-2016-05-17-110552

    Next iteration, no markers shown -> 3599 id latest marker

    device-2016-05-17-110749

    @1ec5 are you seeing the same on iOS? Any idea what the cause of this could be?

  8. tobrun commented on May 17, 2016

    @tobrun
    Member

    @zhemora a workaround for now is to manage the markers yourself. So instead of adding/removing them constantly. I would suggest updating the position by calling setPosition by iterating over the newly received data and comparing this with the old data.

  9. added a commit that references this issue on May 17, 2016
  10. Schumi09 commented on May 17, 2016

    @Schumi09

    Your example matches those observations I have described in the comments of #4778. It happens only if you create new icons for every iteration from resources. I guess if you change your example to make use of an Icon that you always reuse this issue won't appear. However, for my use case i need to create new icons for every itereation as i need to change alpha and orientation (depending of the location of an off screen object).

  11. tobrun commented on May 17, 2016

    @tobrun
    Member

    Thank you @Schumi09 for that remark. It's starting to come back to me and I'm guessing this is related to the limitation of our sprite atlas being 1024x1024. More information about this issue can be found in #3185. I'm going to do some tests around this to find the best way to handle this for now and will be closing this issue in favour of #3185. FWIW #3276 in combination with #4693 will make the use-case possible and will not limit us changing the marker.

  12. afathman commented on May 17, 2016

    @afathman

    I have a similar issue on 4.0.0, removeAnnotations doesn't remove any custom markers.

  13. tobrun commented on May 17, 2016

    @tobrun
    Member

    @afathman that issue should be fixed with 4.0.1

  14. afathman commented on May 17, 2016

    @afathman

    Ah, didn't notice the update. Thanks!

  15. Schumi09 commented on Jun 6, 2016

    @Schumi09

    Thank you @Schumi09 for that remark. It's starting to come back to me and I'm guessing this is related to the limitation of our sprite atlas being 1024x1024. More information about this issue can be found in #3185. I'm going to do some tests around this to find the best way to handle this for now and will be closing this issue in favour of #3185. FWIW #3276 in combination with #4693 will make the use-case possible and will not limit us changing the marker.

    So as the the current state for the 4.1.0 snapshot brought the nice MarkerViews I have replaced the Marker in my project that caused this issue for me with a MarkerView. After several minutes I can still see the MarkerViews. I guess it is save to confirm that your work has fixed this indeed 👍

  16. tobrun commented on Jun 6, 2016

    @tobrun
    Member

    @Schumi09 thanks for validating, going to close this for now since we have the MarkerView workaround.

  17. added this to the android-v4.1.0 milestone on Jun 6, 2016
  18. Emeritus-DarranKelinske commented on Nov 25, 2016

    @Emeritus-DarranKelinske

    Can you please re-open this? Even though there is a workaround the intended/expected functionality does not work.

  19. dazza5000 commented on Nov 26, 2016

    @dazza5000

    Our current testing shows that switching to MarkerViews is a valid workaround.

  20. tobrun commented on Nov 26, 2016

    @tobrun
    Member

    @Emeritus-DarranKelinske I would advice you to look into runtime styling. We are finalising this feature for the 4.2.0 release. These API supports the concept of SymbolLayer which is simaler to what Marker use in the low level API.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions