% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pheno_leaflet.R
\name{pheno_leaflet}
\alias{pheno_leaflet}
\title{Interactive Leaflet Map to Select PEP725 Stations}
\usage{
pheno_leaflet(pep, label_col = NULL, quiet = FALSE)
}
\arguments{
\item{pep}{A data frame or data.table with columns \code{lon}, \code{lat}, and optionally \code{species}.}

\item{label_col}{Optional column name to show as label in popups (e.g. \code{"species"} or \code{"s_id"}).}

\item{quiet}{Logical. If \code{FALSE} (default), displays a message about expected loading time.}
}
\value{
A \code{data.frame} with selected stations (columns: \code{lon}, \code{lat}, and metadata).
}
\description{
Launches a Shiny gadget that allows selection of PEP phenological stations
by drawing a bounding box or clicking individual points on the map.
}
\details{
\strong{Note:} Loading time depends on the size of the dataset. For the full PEP725
dataset with millions of observations, expect 10-20 seconds for the map to fully
render. Consider filtering the data before calling this function to speed up loading:

\preformatted{
# Filter to a specific species first
wheat <- pep[genus == "Triticum"]
selected <- pheno_leaflet(wheat)
}
}
\examples{
if (interactive()) {
pep <- pep_download()

# For faster loading, filter the data first (recommended)
# Grapevine has the longest historical records
pep_subset <- pep[species == "Vitis vinifera"]

if (nrow(pep_subset) > 0) {
  # Launch interactive selection gadget
  selected <- pheno_leaflet(pep_subset, label_col = "species")

  # Inspect selected subset
  print(selected)
}
}
}
\author{
Matthias Templ
}
