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

Reloading a failed MGLMapView #3102

Closed
tomtaylor opened this issue Nov 23, 2015 · 6 comments · Fixed by #4728
Closed

Reloading a failed MGLMapView #3102

tomtaylor opened this issue Nov 23, 2015 · 6 comments · Fixed by #4728
Labels
feature iOS Mapbox Maps SDK for iOS performance Speed, stability, CPU usage, memory usage, or power usage
Milestone

Comments

@tomtaylor
Copy link

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?

@1ec5
Copy link
Contributor

1ec5 commented Nov 23, 2015

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?

@1ec5 1ec5 added iOS Mapbox Maps SDK for iOS performance Speed, stability, CPU usage, memory usage, or power usage labels Nov 23, 2015
@tomtaylor
Copy link
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?

@1ec5
Copy link
Contributor

1ec5 commented Nov 23, 2015

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

@tomtaylor
Copy link
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.

@1ec5
Copy link
Contributor

1ec5 commented Jan 8, 2016

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

@1ec5 1ec5 added this to the ios-v3.2.0 milestone Jan 8, 2016
@1ec5
Copy link
Contributor

1ec5 commented Jan 30, 2016

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature iOS Mapbox Maps SDK for iOS performance Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants