denislexic
denislexic

Reputation: 11342

Mapbox not loading streets and details: Failed to load mapbox://mapbox.mapbox-streets-v6

Just installed MapboxGL through cocoapods. I initialize it in my ViewController like the example given:

 @IBOutlet weak var mapViewWrapper: UIView!

    var mapView: MGLMapView!

    override func viewDidLoad() {
        super.viewDidLoad()

        // Map
        let styleURL = NSURL(string: "asset://styles/dark-v7.json")
        mapView = MGLMapView(frame: mapViewWrapper.bounds, styleURL: styleURL)
        mapView.autoresizingMask = .FlexibleWidth | .FlexibleHeight

        // set the map's center coordinate
        mapView.setCenterCoordinate(CLLocationCoordinate2D(latitude: 38.894368,
            longitude: -77.036487),
            zoomLevel: 15, animated: false)
        mapViewWrapper.addSubview(mapView)

    }

When I launch the app, I see a black square and a Mapbox logo but no streets, see image below enter image description here

In the logs I'm getting this:

[ERROR] {Map}[Style]: Failed to load [mapbox://mapbox.mapbox-streets-v6]: 
[ERROR] {Map}[Style]: Failed to load [mapbox://mapbox.mapbox-terrain-v2]: 

Any ideas what I did wrong?

Upvotes: 3

Views: 1027

Answers (2)

friedbunny
friedbunny

Reputation: 2421

Thanks for reporting this on GitHub, much appreciated. To close the loop here, this problem happened because the Mapbox iOS SDK was inappropriately caching requests made with bad access tokens, which tended to give vague errors that looked like connection issues.

Fixed in v3.1 by this.

Upvotes: 1

incanus
incanus

Reputation: 5128

This may have been an intermittent network or API problem? The usage looks right.

Upvotes: 0

Related Questions