deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

Is there any way to use static base layers like OpenStreetMap tiles with Deck.GL?

Open hyzhak opened this issue 7 years ago • 7 comments

Open Street Map provides tiles on that api:

https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png

How could I use static base layers of Open Street Map in Deck.gl?

hyzhak avatar Dec 16 '18 18:12 hyzhak

Yes, by using the experimental TileLayer with the BitmapLayer. Unfortunately the latter is a little outdated and lacks documentation. We're planning to refresh it for v7.0, and then I can put together an example for your use case. Is this blocking you right now?

Pessimistress avatar Dec 17 '18 20:12 Pessimistress

Big thanks for reply! Yes, I'm working on open source project, and I can't use deck.gl, because it requires MapBox. It would be great to have examples, as starting point. But thanks for mentioned experimental layers, I haven't seen them.

hyzhak avatar Dec 18 '18 00:12 hyzhak

Well, technically, deck.gl does require mapbox. There are examples without map and also prototypes working with Google Maps.

Also, a paid service is not required to use mapbox-gl. You can use OSM raster layers with mapbox (info) or use alternative vector tile service providers (info).

Pessimistress avatar Dec 18 '18 03:12 Pessimistress

First, I want to say thanks for sharing this project!

I came across this PR, which seems to document how to load a raster source like https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png:

https://github.com/uber/deck.gl/pull/2821/files#diff-4f90d4e6ab9c03e5819086ec5ac1848a

and that PR adds an openstreet-map directory to the examples/website directory here: https://github.com/uber/deck.gl/tree/master/examples/website

but I see that it's no longer there. And there is no mention of loading raster tile sources in the TileLayer docs or the BitmapLayer docs.

Is this use case supported? If so, is there any documentation or example of it?

jalMogo avatar Jun 28 '19 05:06 jalMogo

@jalMogo The example is renamed and moved to here

Also it is under the examples category on the website

xintongxia avatar Jun 28 '19 15:06 xintongxia

@hyzhak Have you ever been load tile layer published by youself. I tried load a building layer published by geoserver. #3329, could you help me have a look.

HeiYanjing avatar Jul 17 '19 10:07 HeiYanjing

@xintongxia thank you very much for this example it is a life saver 🙏 !

On an unrelated question, do you know if there is a way to style the openstreetmap example?

Maybe with something like maptiler ?

The following MAP doesn't look too pretty :D

Screenshot 2020-11-01 at 12 20 12

raed667 avatar Nov 01 '20 11:11 raed667