Skip to content

onStyleLoadedCallback fires (n - 1) times the map has been loaded #373

Closed

Description

@JoelGG

I currently need to navigate to a page containing a MapboxMap, and as suggested in the documentation I'm using onStyleLoadedCallback to generate and add all annotations for the map. Unfortunately I have noticed that on first load onStyleLoadedCallback does not fire, and on every subsequent navigation to the map it fires n times for however many times I have navigated to it (after the first navigation to it)

Activity

  1. m0nac0 commented on Aug 7, 2020

    @m0nac0
    Collaborator

    @JoelGG Thank you for the report. On what platform (android/iOS/web) and with which flutter and plugin version does this happen?

  2. JoelGG commented on Aug 11, 2020

    @JoelGG
    Author

    @m0nac0 thank you for your reply. This is on iOS and with the latest version of flutter-mapbox-gl available on pub.

  3. m0nac0 commented on Aug 13, 2020

    @m0nac0
    Collaborator

    @JoelGG Thank you. Might be related to #347 and/or #226 (?)

  4. added
    bug
    on Aug 13, 2020
  5. tonnyavery commented on Sep 5, 2020

    @tonnyavery
    Contributor

    The fact that callback fires more than once points to a memory leak.
    #389
    #370
    #226

  6. m0nac0 commented on Sep 6, 2020

    @m0nac0
    Collaborator

    @aaverin I have very little iOS dev experience, do you happen to have tested #370 and know if it fixes these issues?

  7. tonnyavery commented on Sep 6, 2020

    @tonnyavery
    Contributor

    @m0nac0 I also have very little iOS experience.
    From what I see in the PR, it users weakReference to avoid capturing and holding the reference inside. Not sure if it is the problem exactly.
    At the moment my app is barely usable on iOS due to map issues. I will try to take a look once I have time, but would be best if someone who has more iOS experience could check.
    If the iOS SDK is working fine, then the issue should lie in the integration layer somewhere.

  8. tonnyavery commented on Sep 11, 2020

    @tonnyavery
    Contributor

    @m0nac0 could this be related? Was closed recently and probably is not yet updated in Flutter version: mapbox/mapbox-gl-native-ios#172
    I will test on real device today

  9. tonnyavery commented on Sep 4, 2021

    @tonnyavery
    Contributor

    This seems to still be an issue on a real device.
    onStyleLoadedCallback is not called reliably on iOS

  10. stale commented on Jan 14, 2022

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  11. tonnyavery commented on Jan 14, 2022

    @tonnyavery
    Contributor

    Hopefully all style loading issues were resolved in latest PRs

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

    bugiosstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions