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

Feature request: analog to Google Maps TileProvider #7477

Closed
kjkrum opened this issue Dec 18, 2016 · 4 comments
Closed

Feature request: analog to Google Maps TileProvider #7477

kjkrum opened this issue Dec 18, 2016 · 4 comments
Labels
Android Mapbox Maps SDK for Android

Comments

@kjkrum
Copy link

kjkrum commented Dec 18, 2016

I've recently been learning about MapBox after having used the Google Maps SDK for several Android projects. I've noticed that there seems to be no analog to the Google Maps TileProvider interface, which allows overlays to be rendered in Java code. I believe this is a consequence of the fact that Mapbox rendering is done in native code that is common to the Android and iOS SDKs. This SO Q&A shows how an Android app can draw over the Mapbox map, but that solution draws over labels and markers.

Would it be practical to allow the Android and iOS SDKs to register a native callback that allows Java or (I assume) ObjectiveC code to draw on the base map before labels and markers are rendered?

@tobrun
Copy link
Member

tobrun commented Dec 21, 2016

@kjkrum we aim to match our API with the one that google exposes (at least on Android) but the TileProvider part is something where we differentiate. Instead of allowing users to render something with a TileOverlay, we give you full access to all the layers and sources of the map. This should allow you to draw something between the base map and the markers/labels above. You only need a source and hook into MapboxMap#addLayer(Layer layer, String beforeLayerId) where beforeLayerId is the id of the labels (you can look up the id with Mapbox studio).

More information on RuntimeStyling can be found in this blog post.
More information on the classes etc here.

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Dec 21, 2016
@kjkrum
Copy link
Author

kjkrum commented Jan 5, 2017

From the API docs for Layer, Style, etc., it appears that map tiles and data can only come from recognized URLs. There's no way to generate tiles dynamically on the mobile device, except perhaps by exposing them to the Mapbox API via a URL. Is that correct?

@incanus
Copy link
Contributor

incanus commented Jan 17, 2017

👉 #7471

@kjkrum
Copy link
Author

kjkrum commented Apr 6, 2017

This is still preventing me from ditching Google Maps. I found a similar request in #4210. One of the links there might have been useful, but it's 404 now: custom raster style example.

Everything about the Mapbox API seems to be designed around the assumption that a map will display layers hosted by Mapbox Studio and other online sources. That does not fit my use case. I want users to be able to add layers from files that they provide on their own devices. I can do this in Google Maps with TileProvider, but I can't figure out how to do it in Mapbox.

Would RasterSource(String id, String url) recognize a custom URI scheme exposed by a ContentProvider?

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

No branches or pull requests

4 participants