
Get queried features from a map as an sf object
Source:R/query_rendered_features.R
get_queried_features.Rd
This function retrieves the results of a feature query triggered by query_rendered_features()
.
It returns the features as a deduplicated sf object. Note that only features that were
visible in the viewport at the time of the query will be included.
Examples
if (FALSE) { # \dontrun{
# In a Shiny server function:
observeEvent(input$query_button, {
proxy <- maplibre_proxy("map")
query_rendered_features(proxy, layer_id = "counties")
features <- get_queried_features(proxy)
print(nrow(features))
})
} # }