1
votes

I'm looking for a solution to add other tile source to Mapbox map. For example, I have an tile source url like this https://tile.openstreetmap.org/{z}/{x}/{y}.png and I want to add this tile above original Mapbox Layer. I intend to use RasterLayer, but I don't know which url format should be inputed to this Layer, Mapbox document isn't clear.

Anyone could help me a solution for this issue? Thanks!!

2

2 Answers

0
votes

You should use the RasterSource with a TileSet :

RasterSource source = new RasterSource("source-id", new TileSet("2.1.0", baseUrl + "/{z}/{x}/{y}.png"));
map.addSource(source);
0
votes

Another solution is to upload your tilesets with your mapbox studio account.

Drag and drop a MBTiles, KML, GPX, GeoJSON, Shapefile (zipped), or CSV file here to convert it into vector tiles. To create raster tiles, drag and drop a GeoTIFF file.