protomapr/man/protomaps_sample_tiles.Rd
2026-03-06 15:46:39 +11:00

54 lines
1.5 KiB
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sample-tiles.R
\name{protomaps_sample_tiles}
\alias{protomaps_sample_tiles}
\title{Get Path to Sample PMTiles File}
\usage{
protomaps_sample_tiles(
region = "sf-bay",
cache_dir = NULL,
force_download = FALSE
)
}
\arguments{
\item{region}{Character. Region to download. Currently only "sf-bay"
(San Francisco Bay Area) is available. Default is "sf-bay".}
\item{cache_dir}{Character. Directory to cache the downloaded file.
Default uses \code{tools::R_user_dir()}.}
\item{force_download}{Logical. Force re-download even if cached.
Default is FALSE.}
}
\value{
Character. Path to the PMTiles file.
}
\description{
Returns the path to a sample PMTiles file for demos and testing.
On first use, downloads a small regional extract to the user's cache
directory.
}
\details{
The sample tiles are hosted on GitHub releases and downloaded on first use.
Subsequent calls use the cached file. The SF Bay Area extract is
approximately 10-15MB and covers the greater San Francisco region at all
zoom levels.
For production use, consider self-hosting your own PMTiles file. See
\code{vignette("getting-started")} for options.
}
\examples{
\dontrun{
library(leaflet)
library(protomapr)
# Use sample tiles for demos (downloads on first use)
leaflet() \%>\%
setView(lng = -122.4, lat = 37.8, zoom = 12) \%>\%
addProtomaps(url = protomaps_sample_tiles())
}
}
\seealso{
\code{\link{protomaps_clear_cache}}, \code{\link{protomaps_url}}
}