You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
It’s relatively difficult to add an MGLMapView to a storyboard-based project. As expected, you can drag a UIView into a scene and set its custom class to “MGLMapView”. However, that just gets you a blank map. So you need to call [mapView setAccessToken:@"…"] at launch, and [mapView setStyleJSON:nil] sometime after that, but not too soon or you’ll hit #1014.
Basic support for XIBs and storyboards means:
Make accessToken KVO-compliant, so it can be set via a user-defined runtime attribute in Interface Builder.
We plan to distribute Mapbox GL via CocoaPods (#1030), which handles repackaging the library as a dynamic framework when use_frameworks! is specified (required for Swift usage). That unblocks #929, so we could in principle ship with an inspectable and designable MGLMapView today. However, we need accessToken to be KVO-compliant and trigger a refresh (without hitting #1147) in order to provide the right developer experience.
mbgl::Map is now started on demand, once either the access token or a bundled style name is set. The access token and style name are exposed to clients as ordinary KVO-compliant properties. Actually, they’re not so ordinary because they’re inspectable!
Ref #1070, #1147
`Map` should be able to deal with having no access token or JSON even while it’s running. Most of `Map` accounts for this situation, but `reloadStyle()` incorrectly assumes that one or the other is set. This change corrects the assumption in `reloadStyle()`.
Also expose the access token and style name to clients as ordinary KVO-compliant properties. Actually, they’re not so ordinary because they’re inspectable!
Ref #1070, #1147
It’s relatively difficult to add an
MGLMapView
to a storyboard-based project. As expected, you can drag aUIView
into a scene and set its custom class to “MGLMapView”. However, that just gets you a blank map. So you need to call[mapView setAccessToken:@"…"]
at launch, and[mapView setStyleJSON:nil]
sometime after that, but not too soon or you’ll hit #1014.Basic support for XIBs and storyboards means:
accessToken
KVO-compliant, so it can be set via a user-defined runtime attribute in Interface Builder.-setAccessToken:
should apply the default style if it’s called for the first time and no style has been applied. It’ll be tricky to fix this and avoid triggering [iOS] Crash using bundled style immediately after instantiation #1014 for the usual-initWithFrame:accessToken:
case, so [iOS] Crash using bundled style immediately after instantiation #1014 is probably a blocker.After we get basic support, we can look at enhancing the IB workflow via #929.
The text was updated successfully, but these errors were encountered: