Skip to contents

Creates the tabular association used by addIndoor() to attach one or more photos to indoor features. Each row associates a layerId with one image and its caption. Repeating a layerId creates a carousel in row order.

Usage

indoorPhotoCatalog(layerId, src, caption, alt = caption)

Arguments

layerId

Feature identifiers matching the values supplied to the layerId argument of addIndoor(). A scalar is recycled.

src

Image sources. These may be HTTP(S) URLs, relative URLs, image data URIs, or paths to existing PNG, JPEG, GIF, WebP, or SVG files.

caption

Plain-text captions displayed immediately below their images.

alt

Plain-text alternative text. The default uses caption.

Value

A data frame of class leaflet_indoor_photos with columns layerId, src, caption, and alt.

Details

Existing local image files are embedded as data URIs so saved widgets, vignettes, Quarto documents, and Shiny applications do not depend on the original file path. Web URLs and relative URLs are retained unchanged.

Examples

photos <- indoorPhotoCatalog(
  layerId = c("room-01", "room-01"),
  src = c(
    "https://example.org/room-01-a.jpg",
    "https://example.org/room-01-b.jpg"
  ),
  caption = c("Entrance view", "View from the windows")
)
photos
#>   layerId                               src               caption
#> 1 room-01 https://example.org/room-01-a.jpg         Entrance view
#> 2 room-01 https://example.org/room-01-b.jpg View from the windows
#>                     alt
#> 1         Entrance view
#> 2 View from the windows