Learn R Programming

deckgl (version 0.2.5)

add_bitmap_layer: Add a bitmap layer to the deckgl widget

Description

Add a bitmap layer to the deckgl widget

Usage

add_bitmap_layer(deckgl, id = "h3-hexagon-layer", image = NULL,
  properties = list(), ...)

Arguments

deckgl

deckgl widget

id

id of the layer

image

image

properties

named list of properties with names corresponding to the properties defined in the deckgl-api-reference for the given layer class, additionally there is a getTooltip property (callback) showing a tooltip when the mouse enters an object, e. g. getTooltip = JS("object => object.name")

...

more properties (will be added to the properties object), useful if you want to use a properties object for more than one layer

Examples

Run this code
# NOT RUN {
image <- paste0(
  "https://raw.githubusercontent.com/",
  "uber-common/deck.gl-data/master/",
  "website/sf-districts.png"
)
bounds <- c(-122.5190, 37.7045, -122.355, 37.829)

deck <- deckgl() %>%
  add_bitmap_layer(image = image, bounds = bounds) %>%
  add_mapbox_basemap()

if (interactive()) deck
# }

Run the code above in your browser using DataLab