iosmapbox

How do I transition Mapbox legacy support for raster tilesets?


My iOS app was happy using mapbox with:

https://api.mapbox.com/v4/mapbox.light/\(z)/\(x)/\(y).png?access_token=\(token)

... until mapbox deprecated this type of API support. : /

And now I'm having difficulty in figuring out how to use their new API in replacing this old functionality.

https://api.mapbox.com/styles/v1/mapbox/light-v10/tiles/256/ doesn't provide me with my expected png tiles.

What am I missing?


Solution

  • You haven't provided any information about what is going wrong, but it seems you're on the right path.

    They provide this migration guide: https://docs.mapbox.com/help/troubleshooting/migrate-legacy-static-tiles-api/

    In case this isn't obvious, your complete equivalent URL would be:

    https://api.mapbox.com/styles/v1/mapbox/light-v10/tiles/256/\(z)/\(x)/\(y)?access_token=\(token)