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

54 lines
1.6 KiB
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rules.R
\name{pmLabelRule}
\alias{pmLabelRule}
\title{Create a Label Rule}
\usage{
pmLabelRule(
dataLayer,
symbolizer,
minzoom = NULL,
maxzoom = NULL,
filter = NULL
)
}
\arguments{
\item{dataLayer}{Character. The name of the data layer in the vector
tile source (e.g., "places", "roads").}
\item{symbolizer}{A text symbolizer object created with one of
\code{\link{pmTextSymbolizer}}, \code{\link{pmCenteredTextSymbolizer}},
\code{\link{pmLineLabelSymbolizer}}, or \code{\link{pmShieldSymbolizer}}.}
\item{minzoom}{Numeric. Minimum zoom level at which this rule applies.
Default is NULL (applies at all zoom levels).}
\item{maxzoom}{Numeric. Maximum zoom level at which this rule applies.
Default is NULL (applies at all zoom levels).}
\item{filter}{Character. A JavaScript expression string that filters
features. Default is NULL (no filter).}
}
\value{
A list representing the label rule configuration.
}
\description{
Creates a label rule that specifies how to render text labels for
features from a particular data layer. Label rules control text
placement and styling, with automatic collision detection.
}
\examples{
# Label cities
pmLabelRule("places",
pmCenteredTextSymbolizer(font = "14px Arial",
fill = "black",
stroke = "white",
width = 2))
# Label streets along their paths
pmLabelRule("roads",
pmLineLabelSymbolizer(font = "11px Arial",
fill = "#333"),
minzoom = 14)
}