Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MapBox for iOS, custom style

I created new map style with Mapbox Studio, then I uploaded it to my account (so I see it in styles tab), then I added StyleID to my iOS MGLMapView but when I run app it throws error

[ERROR] {Map}[Setup]: loading style failed: HTTP status code 404

If I don’t use my style, map is working correctly.

like image 913
Dmitry Pilipenko Avatar asked Apr 19 '26 19:04

Dmitry Pilipenko


1 Answers

Try this in viewDidload:

mapView.styleURL = NSURL(string: "asset://styles/dark-v7.json")

Update 1:

For this moment it is not possible to use custom map style with Mapbox GL for iOS.

'First steps with Mapbox GL for iOS':

Changing the map style

At the moment, Mapbox GL comes bundled with a handful of map styles. That’ll all change in a few months, but for now let’s change the map style to Mapbox Dark...

like image 140
Sasha Prokhorenko Avatar answered Apr 21 '26 08:04

Sasha Prokhorenko