protomapr/man/pmCityLabels.Rd

50 lines
1.2 KiB
Text
Raw Permalink Normal View History

2026-03-06 15:46:39 +11:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/styles.R
\name{pmCityLabels}
\alias{pmCityLabels}
\title{Create preset label rules for city names}
\usage{
pmCityLabels(
style = c("hierarchical", "major-only", "all"),
color = "#333333",
halo = "white",
include_regions = TRUE
)
}
\arguments{
\item{style}{Character. Label style preset:
\describe{
\item{"hierarchical"}{Size varies by city importance (min_zoom)}
\item{"major-only"}{Only major cities (min_zoom <= 5)}
\item{"all"}{All cities with uniform styling}
}}
\item{color}{Character. Text color. Default is "#333333".}
\item{halo}{Character. Halo/stroke color. Default is "white".}
\item{include_regions}{Logical. Include state/region labels. Default is TRUE.}
}
\value{
A list of label rules to pass to \code{\link{addProtomaps}}.
}
\description{
Creates label rules for displaying city/place names with common styling
patterns.
}
\examples{
\dontrun{
library(leaflet)
library(protomapr)
leaflet() \%>\%
setView(lng = -122.4, lat = 37.8, zoom = 8) \%>\%
addProtomaps(
url = protomaps_url(),
colors = pmColors(earth = "#f0f0f0", water = "#1a3a5c"),
labelRules = pmCityLabels("hierarchical")
)
}
}