BASEMAP = "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json""https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"
Every deck.gl layer is available, generated from deck.gl’s own prop tables. Each example below is self-contained and ready to copy-paste.
Props may be written snake_case or camelCase — get_fill_color and getFillColor are the same prop — and anything left unset keeps deck.gl’s own default. Any accessor takes a constant, a column name as a Symbol (or a Vector{Symbol} to combine several columns), or JS(...) for a JavaScript function.
Every example draws on a basemap. map_style takes any MapLibre style URL; Carto’s are free and need no API key.
"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"
Omit map_style for a blank background — see Getting Started for the other styles and what a basemap costs.
Core layers draw one shape per record, with no aggregation.
Circles at given coordinates.
data = (
lng = [-122.45, -122.42, -122.38, -122.50, -122.47, -122.41],
lat = [37.78, 37.76, 37.79, 37.77, 37.80, 37.75],
size = [80, 200, 120, 300, 150, 250]
)
Deck(
ScatterplotLayer(
data = data,
get_position = [:lng, :lat],
get_radius = :size,
get_fill_color = [255, 140, 0, 200],
radius_min_pixels = 3,
tooltip = [:size]
),
initial_view_state = ViewState(longitude=-122.44, latitude=37.77, zoom=12),
map_style = BASEMAP
)ScatterplotLayer accessors
| Accessor | Value |
|---|---|
get_fill_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_width |
a value, a column, or JS(...) |
get_pixel_offset |
a value, a column, or JS(...) |
get_position |
a value, a column, or JS(...) |
get_radius |
a value, a column, or JS(...) |
ScatterplotLayer accepts 45 further props. List them with DeckGL.props(ScatterplotLayer), or read the descriptions in the deck.gl reference.
Arcs curving between a source and a target.
trips = (
src_lng = [-122.45, -122.50, -122.42],
src_lat = [37.78, 37.77, 37.76],
dst_lng = [-122.38, -122.41, -122.47],
dst_lat = [37.79, 37.75, 37.80]
)
Deck(
ArcLayer(
data = trips,
get_source_position = [:src_lng, :src_lat],
get_target_position = [:dst_lng, :dst_lat],
get_source_color = [0, 128, 255],
get_target_color = [255, 0, 128],
get_width = 3
),
initial_view_state = ViewState(longitude=-122.44, latitude=37.77, zoom=12),
map_style = BASEMAP
)ArcLayer accessors
| Accessor | Value |
|---|---|
get_height |
a value, a column, or JS(...) |
get_source_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_source_position |
a value, a column, or JS(...) |
get_target_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_target_position |
a value, a column, or JS(...) |
get_tilt |
a value, a column, or JS(...) |
get_width |
a value, a column, or JS(...) |
ArcLayer accepts 39 further props. List them with DeckGL.props(ArcLayer), or read the descriptions in the deck.gl reference.
Straight lines between a source and a target.
connections = (
from_lng = [-122.45, -122.50, -122.42, -122.48],
from_lat = [37.78, 37.77, 37.76, 37.79],
to_lng = [-122.38, -122.41, -122.47, -122.43],
to_lat = [37.79, 37.75, 37.80, 37.74]
)
Deck(
LineLayer(
data = connections,
get_source_position = [:from_lng, :from_lat],
get_target_position = [:to_lng, :to_lat],
get_color = [0, 100, 200],
get_width = 4
),
initial_view_state = ViewState(longitude=-122.44, latitude=37.77, zoom=12),
map_style = BASEMAP
)LineLayer accessors
| Accessor | Value |
|---|---|
get_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_source_position |
a value, a column, or JS(...) |
get_target_position |
a value, a column, or JS(...) |
get_width |
a value, a column, or JS(...) |
LineLayer accepts 37 further props. List them with DeckGL.props(LineLayer), or read the descriptions in the deck.gl reference.
Polylines from sequences of coordinates.
routes = (
path = [
[[-122.45, 37.78], [-122.43, 37.79], [-122.40, 37.78], [-122.38, 37.79]],
[[-122.50, 37.77], [-122.48, 37.76], [-122.45, 37.75], [-122.42, 37.76]],
[[-122.47, 37.80], [-122.44, 37.81], [-122.41, 37.80], [-122.39, 37.81]]
],
)
Deck(
PathLayer(
data = routes,
get_path = :path,
get_color = [0, 128, 255],
get_width = 5,
cap_rounded = true,
joint_rounded = true
),
initial_view_state = ViewState(longitude=-122.44, latitude=37.78, zoom=12),
map_style = BASEMAP
)PathLayer accessors
| Accessor | Value |
|---|---|
get_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_path |
a value, a column, or JS(...) |
get_width |
a value, a column, or JS(...) |
PathLayer accepts 42 further props. List them with DeckGL.props(PathLayer), or read the descriptions in the deck.gl reference.
Filled and stroked polygons, optionally extruded. A composite layer: it delegates fills to SolidPolygonLayer and outlines to PathLayer.
regions = (
polygon = [
[[-122.46, 37.78], [-122.44, 37.78], [-122.44, 37.80], [-122.46, 37.80], [-122.46, 37.78]],
[[-122.43, 37.76], [-122.40, 37.76], [-122.40, 37.78], [-122.43, 37.78], [-122.43, 37.76]],
[[-122.48, 37.74], [-122.45, 37.74], [-122.45, 37.76], [-122.48, 37.76], [-122.48, 37.74]]
],
value = [500, 1200, 800]
)
Deck(
PolygonLayer(
data = regions,
get_polygon = :polygon,
get_fill_color = [255, 140, 0, 100],
get_line_color = [255, 140, 0, 255],
get_line_width = 2,
extruded = true,
get_elevation = :value
),
initial_view_state = ViewState(longitude=-122.44, latitude=37.77, zoom=12, pitch=45),
map_style = BASEMAP
)PolygonLayer accessors
| Accessor | Value |
|---|---|
get_elevation |
a value, a column, or JS(...) |
get_fill_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_width |
a value, a column, or JS(...) |
get_polygon |
a value, a column, or JS(...) |
PolygonLayer accepts 47 further props. List them with DeckGL.props(PolygonLayer), or read the descriptions in the deck.gl reference.
Polygon fills only, without the outline sub-layer. Cheaper than PolygonLayer when you do not need strokes.
SolidPolygonLayer accessors
| Accessor | Value |
|---|---|
get_elevation |
a value, a column, or JS(...) |
get_fill_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_polygon |
a value, a column, or JS(...) |
SolidPolygonLayer accepts 41 further props. List them with DeckGL.props(SolidPolygonLayer), or read the descriptions in the deck.gl reference.
Text labels at coordinates.
cities = (
lng = [-122.42, -122.47, -122.39, -122.50, -122.44],
lat = [37.78, 37.76, 37.79, 37.77, 37.75],
name = ["Downtown", "Sunset", "Marina", "Richmond", "Mission"]
)
Deck(
TextLayer(
data = cities,
get_position = [:lng, :lat],
get_text = :name,
get_size = 18,
get_color = [0, 0, 128],
font_family = "Helvetica, Arial, sans-serif",
background = true,
get_background_color = [255, 255, 255, 200]
),
initial_view_state = ViewState(longitude=-122.44, latitude=37.77, zoom=12),
map_style = BASEMAP
)get_text reads a column of strings, which cannot be packed into a GPU buffer. The column is sent as an array and read by index instead — see Getting Started for how data reaches the browser.
TextLayer accessors
| Accessor | Value |
|---|---|
get_alignment_baseline |
a value, a column, or JS(...) |
get_angle |
a value, a column, or JS(...) |
get_background_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_border_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_border_width |
a value, a column, or JS(...) |
get_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_content_box |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_pixel_offset |
a value, a column, or JS(...) |
get_position |
a value, a column, or JS(...) |
get_size |
a value, a column, or JS(...) |
get_text |
a value, a column, or JS(...) |
get_text_anchor |
a value, a column, or JS(...) |
TextLayer accepts 53 further props. List them with DeckGL.props(TextLayer), or read the descriptions in the deck.gl reference.
Extruded regular polygons — a cylinder or prism per point.
ColumnLayer accessors
| Accessor | Value |
|---|---|
get_elevation |
a value, a column, or JS(...) |
get_fill_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_width |
a value, a column, or JS(...) |
get_position |
a value, a column, or JS(...) |
ColumnLayer accepts 51 further props. List them with DeckGL.props(ColumnLayer), or read the descriptions in the deck.gl reference.
Square columns on a regular grid. Unlike GridLayer it does no aggregation — you supply the cell positions.
GridCellLayer accessors
| Accessor | Value |
|---|---|
get_elevation |
a value, a column, or JS(...) |
get_fill_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_width |
a value, a column, or JS(...) |
get_position |
a value, a column, or JS(...) |
GridCellLayer accepts 52 further props. List them with DeckGL.props(GridCellLayer), or read the descriptions in the deck.gl reference.
Unlit or lit points in 3D, sized in pixels or metres. Positions may carry a third coordinate.
PointCloudLayer accessors
| Accessor | Value |
|---|---|
get_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_normal |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_position |
a value, a column, or JS(...) |
PointCloudLayer accepts 36 further props. List them with DeckGL.props(PointCloudLayer), or read the descriptions in the deck.gl reference.
Sprites from an icon atlas. icon_mapping names the regions of the atlas image, and get_icon picks one per record.
Deck(
IconLayer(
data = sf_points,
get_position = [:lng, :lat],
icon_atlas = "https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/icon-atlas.png",
icon_mapping = Dict("marker" => Dict(
"x" => 0, "y" => 0, "width" => 128, "height" => 128, "anchorY" => 128, "mask" => true)),
get_icon = JS("() => \"marker\""),
get_size = 3,
size_scale = 10,
get_color = [200, 0, 80]
),
initial_view_state = sf_view(zoom = 12),
map_style = BASEMAP
)get_icon is a JavaScript function here because the icon name is a constant; a column of names (get_icon = :kind) works the same way.
IconLayer accessors
| Accessor | Value |
|---|---|
get_angle |
a value, a column, or JS(...) |
get_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_icon |
a value, a column, or JS(...) |
get_pixel_offset |
a value, a column, or JS(...) |
get_position |
a value, a column, or JS(...) |
get_size |
a value, a column, or JS(...) |
IconLayer accepts 44 further props. List them with DeckGL.props(IconLayer), or read the descriptions in the deck.gl reference.
An image georeferenced onto a bounding box.
BitmapLayer accessors
| Accessor | Value |
|---|
BitmapLayer accepts 40 further props. List them with DeckGL.props(BitmapLayer), or read the descriptions in the deck.gl reference.
GeoJSON of any geometry type, fanned out into point, line, and polygon sub-layers.
geojson_data = Dict(
"type" => "FeatureCollection",
"features" => [
Dict("type" => "Feature",
"geometry" => Dict("type" => "Polygon", "coordinates" => [[
[-122.46, 37.78], [-122.44, 37.78], [-122.44, 37.80],
[-122.46, 37.80], [-122.46, 37.78]]]),
"properties" => Dict("name" => "Area A")),
Dict("type" => "Feature",
"geometry" => Dict("type" => "Point", "coordinates" => [-122.42, 37.77]),
"properties" => Dict("name" => "Point B")),
Dict("type" => "Feature",
"geometry" => Dict("type" => "LineString",
"coordinates" => [[-122.48, 37.76], [-122.45, 37.75], [-122.42, 37.76]]),
"properties" => Dict("name" => "Route C")),
]
)
Deck(
GeoJsonLayer(
data = geojson_data,
get_fill_color = [0, 100, 200, 100],
get_line_color = [0, 100, 200, 255],
get_line_width = 3,
get_point_radius = 200,
line_width_min_pixels = 2
),
initial_view_state = ViewState(longitude=-122.44, latitude=37.77, zoom=12),
map_style = BASEMAP
)data may also be a URL string, which deck.gl fetches itself.
GeoJsonLayer accessors
| Accessor | Value |
|---|---|
get_elevation |
a value, a column, or JS(...) |
get_fill_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_icon |
a value, a column, or JS(...) |
get_icon_angle |
a value, a column, or JS(...) |
get_icon_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_icon_pixel_offset |
a value, a column, or JS(...) |
get_icon_size |
a value, a column, or JS(...) |
get_line_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_width |
a value, a column, or JS(...) |
get_point_radius |
a value, a column, or JS(...) |
get_text |
a value, a column, or JS(...) |
get_text_alignment_baseline |
a value, a column, or JS(...) |
get_text_anchor |
a value, a column, or JS(...) |
get_text_angle |
a value, a column, or JS(...) |
get_text_background_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_text_border_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_text_border_width |
a value, a column, or JS(...) |
get_text_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_text_pixel_offset |
a value, a column, or JS(...) |
get_text_size |
a value, a column, or JS(...) |
GeoJsonLayer accepts 79 further props. List them with DeckGL.props(GeoJsonLayer), or read the descriptions in the deck.gl reference.
Aggregation layers bin records before drawing, so what you see is one shape per bin rather than per record. They read every record through its accessor, which is why they receive data differently from the layers above — see Getting Started.
Picking one selects a bin, so a tooltip shows the bin’s own aggregated values.
Hexagonal bins, optionally extruded by an aggregate.
earthquakes = let n = 200
(lng = -122.4 .+ 0.2 * randn(n),
lat = 37.8 .+ 0.15 * randn(n),
magnitude = 1.0 .+ 3.0 * rand(n))
end
Deck(
HexagonLayer(
data = earthquakes,
get_position = [:lng, :lat],
get_elevation_weight = :magnitude,
radius = 500,
elevation_scale = 50,
extruded = true,
coverage = 0.9,
tooltip = true
),
initial_view_state = ViewState(longitude=-122.4, latitude=37.8, zoom=11, pitch=45),
map_style = BASEMAP
)HexagonLayer accessors
| Accessor | Value |
|---|---|
get_color_value |
a value, a column, or JS(...) |
get_color_weight |
a value, a column, or JS(...) |
get_elevation_value |
a value, a column, or JS(...) |
get_elevation_weight |
a value, a column, or JS(...) |
get_position |
a value, a column, or JS(...) |
HexagonLayer accepts 54 further props. List them with DeckGL.props(HexagonLayer), or read the descriptions in the deck.gl reference.
Square bins, the rectangular counterpart to HexagonLayer.
GridLayer accessors
| Accessor | Value |
|---|---|
get_color_value |
a value, a column, or JS(...) |
get_color_weight |
a value, a column, or JS(...) |
get_elevation_value |
a value, a column, or JS(...) |
get_elevation_weight |
a value, a column, or JS(...) |
get_position |
a value, a column, or JS(...) |
GridLayer accepts 54 further props. List them with DeckGL.props(GridLayer), or read the descriptions in the deck.gl reference.
A density surface, computed on the GPU. It renders through a framebuffer rather than geometry, so it has nothing pickable.
incidents = let n = 500
lng1 = -122.45 .+ 0.03 * randn(n ÷ 2); lat1 = 37.78 .+ 0.02 * randn(n ÷ 2)
lng2 = -122.40 .+ 0.02 * randn(n ÷ 2); lat2 = 37.76 .+ 0.015 * randn(n ÷ 2)
(lng = vcat(lng1, lng2), lat = vcat(lat1, lat2), severity = 1.0 .+ 4.0 * rand(n))
end
Deck(
HeatmapLayer(
data = incidents,
get_position = [:lng, :lat],
get_weight = :severity,
radius_pixels = 50,
intensity = 1,
threshold = 0.03
),
initial_view_state = ViewState(longitude=-122.43, latitude=37.77, zoom=12),
map_style = BASEMAP
)HeatmapLayer accessors
| Accessor | Value |
|---|---|
get_position |
a value, a column, or JS(...) |
get_weight |
a value, a column, or JS(...) |
HeatmapLayer accepts 41 further props. List them with DeckGL.props(HeatmapLayer), or read the descriptions in the deck.gl reference.
Iso-lines and iso-bands over a binned density. Each entry in contours is a threshold with a colour; a two-element threshold makes a filled band instead of a line.
Deck(
ContourLayer(
data = incidents,
get_position = [:lng, :lat],
get_weight = :severity,
cell_size = 300,
contours = [
Dict("threshold" => 5, "color" => [255, 200, 0], "strokeWidth" => 2),
Dict("threshold" => 15, "color" => [255, 100, 0], "strokeWidth" => 3),
Dict("threshold" => 30, "color" => [200, 0, 0], "strokeWidth" => 4),
]
),
initial_view_state = ViewState(longitude=-122.43, latitude=37.77, zoom=12),
map_style = BASEMAP
)ContourLayer accessors
| Accessor | Value |
|---|---|
get_position |
a value, a column, or JS(...) |
get_weight |
a value, a column, or JS(...) |
ContourLayer accepts 39 further props. List them with DeckGL.props(ContourLayer), or read the descriptions in the deck.gl reference.
Bins in screen space, so the cells stay a fixed pixel size as you zoom.
ScreenGridLayer accessors
| Accessor | Value |
|---|---|
get_position |
a value, a column, or JS(...) |
get_weight |
a value, a column, or JS(...) |
ScreenGridLayer accepts 39 further props. List them with DeckGL.props(ScreenGridLayer), or read the descriptions in the deck.gl reference.
Geo layers understand geospatial indexing schemes and tiled data sources.
ArcLayer following the shortest path over the globe. Most visible at continental distances.
flights = (
from_lng = [-122.4, -74.0, -0.1],
from_lat = [37.8, 40.7, 51.5],
to_lng = [139.7, 2.35, 151.2],
to_lat = [35.7, 48.86, -33.9]
)
Deck(
GreatCircleLayer(
data = flights,
get_source_position = [:from_lng, :from_lat],
get_target_position = [:to_lng, :to_lat],
get_source_color = [0, 200, 255],
get_target_color = [255, 0, 128],
get_width = 3
),
initial_view_state = ViewState(longitude=20, latitude=30, zoom=1),
map_style = BASEMAP
)GreatCircleLayer accessors
| Accessor | Value |
|---|---|
get_height |
a value, a column, or JS(...) |
get_source_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_source_position |
a value, a column, or JS(...) |
get_target_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_target_position |
a value, a column, or JS(...) |
get_tilt |
a value, a column, or JS(...) |
get_width |
a value, a column, or JS(...) |
GreatCircleLayer accepts 39 further props. List them with DeckGL.props(GreatCircleLayer), or read the descriptions in the deck.gl reference.
Paths animated over time. get_timestamps gives one time per vertex, and current_time sweeps a fading trail along the path.
Animating means re-rendering with a new current_time; a static page shows one frame.
TripsLayer accessors
| Accessor | Value |
|---|---|
get_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_path |
a value, a column, or JS(...) |
get_timestamps |
a value, a column, or JS(...) |
get_width |
a value, a column, or JS(...) |
TripsLayer accepts 45 further props. List them with DeckGL.props(TripsLayer), or read the descriptions in the deck.gl reference.
Loads a tiled data source for the current viewport. render_sub_layers decides how each tile is drawn — here as a BitmapLayer, which makes this a raster basemap.
Deck(
TileLayer(
data = "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
min_zoom = 0,
max_zoom = 19,
tile_size = 256,
render_sub_layers = JS("""props => new deck.BitmapLayer(props, {
data: null,
image: props.data,
bounds: [props.tile.boundingBox[0][0], props.tile.boundingBox[0][1],
props.tile.boundingBox[1][0], props.tile.boundingBox[1][1]]
})""")
),
initial_view_state = sf_view(zoom = 12)
)TileLayer accessors
| Accessor | Value |
|---|
TileLayer accepts 53 further props. List them with DeckGL.props(TileLayer), or read the descriptions in the deck.gl reference.
Mapbox Vector Tiles, styled with the same props as GeoJsonLayer.
Not rendered here: vector tiles are fetched with fetch, which most tile servers refuse from a page with an opaque origin — a file:// page or a sandboxed iframe like the ones on this site. Served over http(s) from a host the tile server allows, it works.
MVTLayer accessors
| Accessor | Value |
|---|---|
get_elevation |
a value, a column, or JS(...) |
get_fill_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_icon |
a value, a column, or JS(...) |
get_icon_angle |
a value, a column, or JS(...) |
get_icon_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_icon_pixel_offset |
a value, a column, or JS(...) |
get_icon_size |
a value, a column, or JS(...) |
get_line_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_width |
a value, a column, or JS(...) |
get_point_radius |
a value, a column, or JS(...) |
get_text |
a value, a column, or JS(...) |
get_text_alignment_baseline |
a value, a column, or JS(...) |
get_text_anchor |
a value, a column, or JS(...) |
get_text_angle |
a value, a column, or JS(...) |
get_text_background_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_text_border_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_text_border_width |
a value, a column, or JS(...) |
get_text_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_text_pixel_offset |
a value, a column, or JS(...) |
get_text_size |
a value, a column, or JS(...) |
MVTLayer accepts 102 further props. List them with DeckGL.props(MVTLayer), or read the descriptions in the deck.gl reference.
A mesh reconstructed from terrain-RGB elevation tiles, draped with a texture. elevation_decoder says how the elevation is encoded in the tile’s colour channels.
Deck(
TerrainLayer(
elevation_data = "https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png",
elevation_decoder = Dict("rScaler" => 256, "gScaler" => 1, "bScaler" => 1/256,
"offset" => -32768),
texture = "https://tile.openstreetmap.org/{z}/{x}/{y}.png"
),
initial_view_state = ViewState(longitude=-119.55, latitude=37.74, zoom=11, pitch=60)
)TerrainLayer accessors
| Accessor | Value |
|---|
TerrainLayer accepts 62 further props. List them with DeckGL.props(TerrainLayer), or read the descriptions in the deck.gl reference.
OGC 3D Tiles and Cesium ion tilesets.
Not rendered here: Tile3DLayer needs the @loaders.gl/3d-tiles loader, which the deck.gl bundle does not include. Load it yourself and pass it through:
Tile3DLayer accessors
| Accessor | Value |
|---|---|
get_point_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
Tile3DLayer accepts 40 further props. List them with DeckGL.props(Tile3DLayer), or read the descriptions in the deck.gl reference.
Cells of Uber’s H3 grid, addressed by index string.
h3_cells = (
hex = ["8828308281fffff", "88283082b3fffff", "88283082b9fffff",
"8828308287fffff", "8828308285fffff", "88283082bbfffff"],
value = [10.0, 25.0, 8.0, 32.0, 17.0, 21.0]
)
Deck(
H3HexagonLayer(
data = h3_cells,
get_hexagon = :hex,
get_fill_color = [0, 128, 255, 180],
get_line_color = [255, 255, 255],
extruded = false,
stroked = true,
tooltip = [:value]
),
initial_view_state = sf_view(zoom = 12),
map_style = BASEMAP
)The H3 layers need the h3-js library, which deck.gl declares as a peer dependency and leaves out of its bundle. Pages containing one load it automatically, from the network.
H3HexagonLayer accessors
| Accessor | Value |
|---|---|
get_elevation |
a value, a column, or JS(...) |
get_fill_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_hexagon |
a value, a column, or JS(...) |
get_line_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_width |
a value, a column, or JS(...) |
get_polygon |
a value, a column, or JS(...) |
H3HexagonLayer accepts 50 further props. List them with DeckGL.props(H3HexagonLayer), or read the descriptions in the deck.gl reference.
A set of H3 cells merged into one outlined region per record.
H3ClusterLayer accessors
| Accessor | Value |
|---|---|
get_elevation |
a value, a column, or JS(...) |
get_fill_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_hexagons |
a value, a column, or JS(...) |
get_line_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_width |
a value, a column, or JS(...) |
get_polygon |
a value, a column, or JS(...) |
H3ClusterLayer accepts 47 further props. List them with DeckGL.props(H3ClusterLayer), or read the descriptions in the deck.gl reference.
Cells of the geohash grid. Longer strings are smaller cells.
GeohashLayer accessors
| Accessor | Value |
|---|---|
get_elevation |
a value, a column, or JS(...) |
get_fill_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_geohash |
a value, a column, or JS(...) |
get_line_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_width |
a value, a column, or JS(...) |
get_polygon |
a value, a column, or JS(...) |
GeohashLayer accepts 47 further props. List them with DeckGL.props(GeohashLayer), or read the descriptions in the deck.gl reference.
Bing Maps quadkey tiles. Each digit descends one zoom level, so the string length is the zoom.
# Tile (x, y) at zoom z as a quadkey string.
quadkey(x, y, z) = join((((x >> (i-1)) & 1) + 2 * ((y >> (i-1)) & 1) for i in z:-1:1))
tiles = (q = [quadkey(654 + i, 1582 + j, 12) for i in 0:2 for j in 0:2],
v = collect(1.0:9.0))
Deck(
QuadkeyLayer(
data = tiles,
get_quadkey = :q,
get_fill_color = [200, 0, 200, 140],
get_line_color = [120, 0, 120],
stroked = true,
tooltip = [:q]
),
initial_view_state = sf_view(),
map_style = BASEMAP
)QuadkeyLayer accessors
| Accessor | Value |
|---|---|
get_elevation |
a value, a column, or JS(...) |
get_fill_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_width |
a value, a column, or JS(...) |
get_polygon |
a value, a column, or JS(...) |
get_quadkey |
a value, a column, or JS(...) |
QuadkeyLayer accepts 47 further props. List them with DeckGL.props(QuadkeyLayer), or read the descriptions in the deck.gl reference.
Cells of Google’s S2 grid, addressed by token.
S2Layer accessors
| Accessor | Value |
|---|---|
get_elevation |
a value, a column, or JS(...) |
get_fill_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_width |
a value, a column, or JS(...) |
get_polygon |
a value, a column, or JS(...) |
get_s2_token |
a value, a column, or JS(...) |
S2Layer accepts 47 further props. List them with DeckGL.props(S2Layer), or read the descriptions in the deck.gl reference.
Cells of the A5 pentagonal grid. Like the H3 layers it needs a peer library, a5-js, which is loaded automatically.
# A5 cell ids are 64-bit and exceed what a JSON number can represent, so they travel as
# strings and become BigInts in the browser.
a5_ids = ["1937280114513412096", "1936189398978658304", "1937275716466900992"]
Deck(
A5Layer(
data = (cell = a5_ids,),
get_pentagon = JS("((ids) => (_, info) => BigInt(ids[info.index]))($(DeckGL.js(a5_ids)))"),
get_fill_color = [255, 140, 0, 180],
get_line_color = [180, 90, 0],
stroked = true
),
initial_view_state = sf_view(zoom = 9),
map_style = BASEMAP
)A5Layer accessors
| Accessor | Value |
|---|---|
get_elevation |
a value, a column, or JS(...) |
get_fill_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_line_width |
a value, a column, or JS(...) |
get_pentagon |
a value, a column, or JS(...) |
get_polygon |
a value, a column, or JS(...) |
A5Layer accepts 47 further props. List them with DeckGL.props(A5Layer), or read the descriptions in the deck.gl reference.
Mesh layers place 3D geometry at each record’s position.
One mesh, instanced at every position. The mesh is a JavaScript object of vertex attributes, so it is supplied with JS.
cube = JS("""{attributes: {POSITION: {value: new Float32Array([
-1,-1,-1, 1,-1,-1, 1, 1,-1, -1,-1,-1, 1, 1,-1, -1, 1,-1,
-1,-1, 1, 1, 1, 1, 1,-1, 1, -1,-1, 1, -1, 1, 1, 1, 1, 1,
-1,-1,-1, -1, 1, 1, -1,-1, 1, -1,-1,-1, -1, 1,-1, -1, 1, 1,
1,-1,-1, 1,-1, 1, 1, 1, 1, 1,-1,-1, 1, 1, 1, 1, 1,-1,
-1, 1,-1, 1, 1,-1, 1, 1, 1, -1, 1,-1, 1, 1, 1, -1, 1, 1,
-1,-1,-1, 1,-1, 1, 1,-1,-1, -1,-1,-1, -1,-1, 1, 1,-1, 1]), size: 3}}}""")
Deck(
SimpleMeshLayer(
data = sf_points,
get_position = [:lng, :lat],
mesh = cube,
size_scale = 200,
get_color = [255, 140, 0]
),
initial_view_state = sf_view(zoom = 12, pitch = 45),
map_style = BASEMAP
)SimpleMeshLayer accessors
| Accessor | Value |
|---|---|
get_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_orientation |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_position |
a value, a column, or JS(...) |
get_scale |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_transform_matrix |
a value, a column, or JS(...) |
get_translation |
[R,G,B]/[R,G,B,A], a hex string, or a column |
SimpleMeshLayer accepts 40 further props. List them with DeckGL.props(SimpleMeshLayer), or read the descriptions in the deck.gl reference.
A glTF/GLB scene instanced at every position, with its materials and animations.
Deck(
ScenegraphLayer(
data = sf_points,
get_position = [:lng, :lat],
scenegraph = "https://raw.githubusercontent.com/visgl/deck.gl-data/master/examples/scenegraph-layer/airplane.glb",
size_scale = 300,
get_orientation = JS("() => [0, 45, 90]"),
_lighting = "pbr"
),
initial_view_state = sf_view(zoom = 12),
map_style = BASEMAP
)ScenegraphLayer accessors
| Accessor | Value |
|---|---|
get_color |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_orientation |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_position |
a value, a column, or JS(...) |
get_scale |
[R,G,B]/[R,G,B,A], a hex string, or a column |
get_transform_matrix |
a value, a column, or JS(...) |
get_translation |
[R,G,B]/[R,G,B,A], a hex string, or a column |
ScenegraphLayer accepts 43 further props. List them with DeckGL.props(ScenegraphLayer), or read the descriptions in the deck.gl reference.
The full set generated from deck.gl v9.3.11:
| Layer | Kind | Reference |
|---|---|---|
A5Layer |
composite | deck.gl |
ArcLayer |
primitive | deck.gl |
BitmapLayer |
primitive | deck.gl |
ColumnLayer |
primitive | deck.gl |
ContourLayer |
aggregation | deck.gl |
GeoJsonLayer |
composite | deck.gl |
GeohashLayer |
composite | deck.gl |
GreatCircleLayer |
primitive | deck.gl |
GridCellLayer |
primitive | deck.gl |
GridLayer |
aggregation | deck.gl |
H3ClusterLayer |
composite | deck.gl |
H3HexagonLayer |
composite | deck.gl |
HeatmapLayer |
aggregation | deck.gl |
HexagonLayer |
aggregation | deck.gl |
IconLayer |
primitive | deck.gl |
LineLayer |
primitive | deck.gl |
MVTLayer |
composite | deck.gl |
PathLayer |
primitive | deck.gl |
PointCloudLayer |
primitive | deck.gl |
PolygonLayer |
composite | deck.gl |
QuadkeyLayer |
composite | deck.gl |
S2Layer |
composite | deck.gl |
ScatterplotLayer |
primitive | deck.gl |
ScenegraphLayer |
primitive | deck.gl |
ScreenGridLayer |
aggregation | deck.gl |
SimpleMeshLayer |
primitive | deck.gl |
SolidPolygonLayer |
primitive | deck.gl |
TerrainLayer |
composite | deck.gl |
TextLayer |
composite | deck.gl |
Tile3DLayer |
composite | deck.gl |
TileLayer |
composite | deck.gl |
TripsLayer |
primitive | deck.gl |