Skip to content

Commit

Permalink
Update deck.gl docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kuethe committed May 31, 2024
1 parent 712a90f commit fc97c21
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 13 deletions.
23 changes: 23 additions & 0 deletions docs/deckgl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Deck.GL layers can be added to the map with `Map.add_deck_layers`.

They are defined as a dictionary, where classes got the `@@type` prefix and getter props
the `@@=` prefix. They are inserted into the layer stack of the maplibre context. Therefore,
you can also pass a `beforeId` prop.

Here is an example corredponding to the [Deck.GL GridLayer API Example](https://deck.gl/docs/api-reference/aggregation-layers/grid-layer):

```python
grid_layer = {
"@@type": "GridLayer", # JS: new GridLayer
"id": "my-awsome-grid-layer",
"data": "https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/sf-bike-parking.json",
"extruded": True,
"getPosition": "@@=COORDINATES", # JS: d => d.COORDINATES
"getColorWeight": "@@=SPACES", # JS: d => d.SPACES
"getElevationWeight": "@@=SPACES", # JS: d => d.SPACES
"elevationScale": 4,
"cellSize": 200,
"pickable": True,
"beforeId": "first-labels-layer" # optional
}
```
Loading

0 comments on commit fc97c21

Please sign in to comment.