arc_map_proxy() wraps a map that is already on screen. set_basemap(),
set_view() and add_layer() all work on the result, and arc_update()
sends the accumulated changes to the browser as one message.
Arguments
- output_id
Defines which
arcgisMapOutput()to update.- session
default
shiny::getDefaultReactiveDomain(). Defines the Shiny session to send through.
Value
An ArcMapProxy, which add_layer() and the map set_*()
functions accept.
Details
Only what changed crosses the wire. A basemap or view change carries no
data at all, and a layer already drawn is never resent - it is filtered,
highlighted, hidden or removed in place by set_filter(),
set_selection(), set_layer() and remove_layer().
A layer added through a proxy must be named, because the name is what identifies it to those functions. Adding one whose name is already on the map replaces it.
Examples
# Inside a Shiny server:
if (interactive()) {
arc_map_proxy("map") |>
set_basemap("satellite") |>
arc_update()
}