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

Black screen while loading map first time in offline iOS #3789

Closed
gurumaheshPCS opened this issue Feb 2, 2016 · 4 comments
Closed

Black screen while loading map first time in offline iOS #3789

gurumaheshPCS opened this issue Feb 2, 2016 · 4 comments
Labels
iOS Mapbox Maps SDK for iOS support

Comments

@gurumaheshPCS
Copy link

Hi,
For the first time i am loading the app. internet is not available. i am seeing black screen. Once i got internet how to reload the map in iOS.

@friedbunny
Copy link
Contributor

Mapbox styles must be downloaded from the network before they can be cached, as must the map data. You can load a local style, but this will only effectively change the first-load background color of your map if there is no internet connection.

True offline support is a feature we're currently working on in #584 and expect to be available sometime in the next few months — but Mapbox's terms of service require that your users be the ones to download the map data, so the first load experience will likely be much the same as it currently is.

@jfirebaugh jfirebaugh changed the title Black screen while loading map first time in offline iOS Black screen while loading map first time in offline iOS Feb 2, 2016
@friedbunny
Copy link
Contributor

Once i got internet how to reload the map in iOS.

Apologies, I appear to have missed this part of the question. See #3102 (comment) for one suggested way to reload a failed style on iOS.

@friedbunny friedbunny added the iOS Mapbox Maps SDK for iOS label Feb 2, 2016
@taylortrimble
Copy link

Hi @friedbunny. I notice that whenever I load the app in airplane mode, I have the black background described, for the reason you described. However, I'd prefer this looked a little – well – better – for my users who haven't turned on their network yet. I would provide a little card over the screen nudging them to turn on their radios.

I basically want an interim background color other than black while the map loads.

I'm also wondering if this is related to the FOUC @incanus reported yesterday in #5795; though it would have to be a slightly different manifestation, since my black square is the whole map background.

@friedbunny
Copy link
Contributor

@tylrtrmbl I don’t have a good answer for you, but you could try a couple things:

  • MGLMapView.opaque = NO and insert a placeholder view below your map view. This will probably flash your placeholder before showing the actual map content.
  • Show the placeholder view and wait to add the map view to the hierarchy until you’re sure it can display content.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS support
Projects
None yet
Development

No branches or pull requests

3 participants