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

iOS tile source bridge API #836

Closed
incanus opened this issue Feb 10, 2015 · 10 comments
Closed

iOS tile source bridge API #836

incanus opened this issue Feb 10, 2015 · 10 comments
Assignees
Labels
iOS Mapbox Maps SDK for iOS

Comments

@incanus
Copy link
Contributor

incanus commented Feb 10, 2015

Easy to way to use old RMTileSource protocol on iOS.

@incanus incanus added the iOS Mapbox Maps SDK for iOS label Feb 10, 2015
@fotiDim
Copy link

fotiDim commented Feb 22, 2015

Definitely need that

@incanus incanus added this to the iOS Beta 2 milestone Mar 31, 2015
@incanus
Copy link
Contributor Author

incanus commented Apr 3, 2015

Related to this, with the recent addition of -[MGLMapView setMapID:], folks will probably expect SDK-style raster layers to work easily.

@incanus incanus mentioned this issue Apr 21, 2015
@incanus
Copy link
Contributor Author

incanus commented Jun 1, 2015

We are splitting the GL ID's into mapID and styleID. Raster-based sources aren't a priority for b2, but in b3 and later we will be picking this back up.

@incanus incanus removed this from the iOS Beta 2 milestone Jun 1, 2015
@incanus
Copy link
Contributor Author

incanus commented Jul 7, 2015

The main problem here is that the styleID API expects an HTTP or local style URL. While we could generate a style, we can't actually easily host it in a place that GL could consume as a vector style.

Other ideas:

  • Auto-parse return of mapbox:// URLs and if TileJSON for rasters, just auto-build a style which shows them. Related: Improve style 404 error #1841
  • Add a new protocol (e.g. mapbox-raster://) for this.
  • Create a command line tool that helps generate the JSON style around a single raster source for inclusion in an app.

@incanus
Copy link
Contributor Author

incanus commented Jul 7, 2015

As an example, this is all that's required to use a legacy raster map ID in GL:

{
  "version": 7,
  "name": "Raster",
  "sources": {
    "raster": {
      "type": "raster",
      "url": "mapbox://examples.map-pgygbwdm",
      "tileSize": 256
    }
  },
  "layers": [{
    "id": "raster",
    "type": "raster",
    "source": "raster",
    "paint": {
      "raster-fade-duration": 100
    }
  }]
}

@incanus incanus self-assigned this Jul 7, 2015
@incanus
Copy link
Contributor Author

incanus commented Jul 7, 2015

Use like so:

[self.mapView setRasterMapID:@"examples.map-pgygbwdm"];

@incanus incanus added this to the iOS Beta 3 milestone Jul 7, 2015
@incanus
Copy link
Contributor Author

incanus commented Jul 7, 2015

👉 #1844

@incanus
Copy link
Contributor Author

incanus commented Jul 8, 2015

Let's push this from b3; it's a nice hack, but let's take the time to do this right.

@incanus incanus removed this from the iOS Beta 3 milestone Jul 8, 2015
@datwelk
Copy link

datwelk commented Jan 13, 2016

Is this work in progress or still waiting to be picked up?

@friedbunny
Copy link
Contributor

So far we've not added a legacy-raster-specific API for setting the map style and, at this point, I don't think that we will.

Have no fear, though, because this example shows how to use a Mapbox-hosted raster tile map with this SDK via a custom GL style.

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

No branches or pull requests

5 participants