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.

Reloading a failed MGLMapView #3102

Closed

Description

@tomtaylor

If a MGLMapView fails to load (due to not being able to fetch the styles, usually for network reasons), is there a recommended way of trying again, other than unsetting and setting the styleURL?

Activity

  1. 1ec5 commented on Nov 23, 2015

    @1ec5
    Contributor

    If MGLMapView fails to load the style due to network issues, it uses Reachability to try again when the network connection comes back. Is that not working for you?

  2. added
    iOS
    performance
    on Nov 23, 2015
  3. tomtaylor commented on Nov 23, 2015

    @tomtaylor
    Author

    I've seen situations where I end up with a blank, black map, and no way of explicitly retrying. Temporary DNS outages, etc. It might be handy to have an explicit method to retry for situations Reachability can't cover?

  4. 1ec5 commented on Nov 23, 2015

    @1ec5
    Contributor

    A general-purpose reload method could be helpful, especially in light of the offline features that @incanus is working on for #584.

  5. tomtaylor commented on Nov 23, 2015

    @tomtaylor
    Author

    Mostly for my own memory: to reproduce this, start a MGLMapView on a device in airplane mode, wait for it to log that the internet connection appears to be offline, and then disable airplane mode. The map doesn't attempt to load the style.

    @1ec5 is this expected? I'd have thought Reachability would cover this.

  6. 1ec5 commented on Jan 8, 2016

    @1ec5
    Contributor

    This simple API exists in the Mapbox OS X SDK and needs to be ported over to the iOS version.

  7. added this to the ios-v3.2.0 milestone on Jan 8, 2016
  8. 1ec5 commented on Jan 30, 2016

    @1ec5
    Contributor

    Until this is fixed, the workaround is to set the style URL to a bogus local relative URL, such as [NSURL URLWithString:@"issue-1302"], then set it back to the original style URL.

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

    featureiOSperformance

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions