protomapr/man/pmPaintRule.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{pmPaintRule}
\alias{pmPaintRule}
\title{Create a Paint Rule}
\usage{
pmPaintRule(
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., "water", "earth", "roads").}
\item{symbolizer}{A symbolizer object created with one of the symbolizer
functions (e.g., \code{\link{pmPolygonSymbolizer}},
\code{\link{pmLineSymbolizer}}).}
\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. The expression has access to \code{zoom} and \code{feature}
variables. Default is NULL (no filter).}
}
\value{
A list representing the paint rule configuration.
}
\description{
Creates a paint rule that specifies how to render features from a
particular data layer. Paint rules control the visual appearance of
polygon, line, and point features.
}
\examples{
# Render water polygons in blue
pmPaintRule("water", pmPolygonSymbolizer(fill = "steelblue"))
# Render roads with zoom-dependent visibility
pmPaintRule("roads", pmLineSymbolizer(color = "gray", width = 2),
minzoom = 10)
# Filter to only show highways
pmPaintRule("roads",
pmLineSymbolizer(color = "orange", width = 4),
filter = "feature.props.kind === 'highway'")
}