Add a PMTiles source to a Mapbox GL or Maplibre GL map
Examples
if (FALSE) { # \dontrun{
# Visualize the Overture Maps places data as PMTiles
# Works with either `maplibre()` or `mapboxgl()`
library(mapgl)
maplibre(style = maptiler_style("basic", variant = "dark")) |>
set_projection("globe") |>
add_pmtiles_source(
id = "places-source",
url = "https://overturemaps-tiles-us-west-2-beta.s3.amazonaws.com/2025-06-25/places.pmtiles"
) |>
add_circle_layer(
id = "places-layer",
source = "places-source",
source_layer = "place",
circle_color = "cyan",
circle_opacity = 0.7,
circle_radius = 4,
tooltip = concat(
"Name: ",
get_column("@name"),
"<br>Confidence: ",
number_format(get_column("confidence"), maximum_fraction_digits = 2)
)
)
} # }