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

mapbox tile as a datasource

Open williaster opened this issue 9 years ago • 6 comments

Is it possible to use data from mapbox tiles directly as a datasource for a component layer?

This would be really nice for things like buildings or enterprise boundaries that are already part of the tiles. e.g., for buildings, from the mapbox docs you can simply reference the building source layer:

map.addLayer({
  'id': '3d-buildings',
  'source': 'composite',
  'source-layer': 'building',
  'filter': ['==', 'extrude', 'true'],
  'type': 'fill-extrusion',
  'minzoom': 15,
  'paint': {
    'fill-extrusion-color': '#aaa',
    'fill-extrusion-height': {
        'type': 'identity',
        'property': 'height'
    },
    'fill-extrusion-base': {
        'type': 'identity',
        'property': 'min_height'
    },
    'fill-extrusion-opacity': .6
  }
});

williaster avatar Sep 01 '17 18:09 williaster

@williaster Creating a layer that reads map tiles is an interesting idea, but there hasn't been any work on it.

You can of course set such extruded map styles on the underlying map (e.g. layering deck.gl on top of react-map-gl), but mapbox and deck.gl will use different Z-buffers so it doesn't work well for extruded map layers.

ibgreen avatar Sep 06 '17 17:09 ibgreen

Any updates on this ?

I'm trying to understand if deck.gl can be used as a full replacement of mapbox-gl capabilities, and thus if we can show vector tiles on deck.gl

cyrilchapon avatar Jul 16 '18 07:07 cyrilchapon

@cyrilchapon , @williaster

Not sure if either of you are still thinking about this, but for anyone else who ends up here looking for an answer to this question:

It looks like there's an experiment TileLayer available https://github.com/uber/deck.gl/blob/master/modules/experimental-layers/src/tile-layer/tile-layer.md

I haven't tried it yet, but it looks like it fits pretty much perfectly with what I need. Hope it helps

Harrisandwich avatar Nov 02 '18 17:11 Harrisandwich

@williaster Hi, deck.gl support add mapbox layer now. #3316 ,I tried . but have some error. could you help me take a look ?

HeiYanjing avatar Jul 17 '19 10:07 HeiYanjing

@williaster #3329 ,not #3316

HeiYanjing avatar Jul 17 '19 10:07 HeiYanjing

Is there already a more consistent implementation of these mapbox buildings tiles in the deck?

ismaelheinen avatar Jul 11 '23 12:07 ismaelheinen