The plugin allows you to synchronize and unsynchronize multiple leaflet maps
in a Shiny application. You can pass additional options
to leafletsyncOptions
. For more information see
Leaflet.Sync
addLeafletsync(
map,
ids = NULL,
synclist = "all",
options = leafletsyncOptions()
)
the map
the map ids to be synced. If you use a synclist
, you may
leave it NULL.
The unique names and values of synclist
will
be used.
The synchronization list. The default is 'all'
, which
creates a list of all possible combinations of ids
. For a more
detailed control, a named list can be passed in this form
list(m1 = c("m2", "m3"), m2 = c("m1", "m3"), m3 = c("m1", "m2"))
,
where the names and values represent map-ids. The names of the lists serve
as a basis and the list values are the maps to be kept in sync with the
basemap.
A named list of options. See leafletsyncOptions
.
If you want to add different options to multiple maps, you can wrap the
options in a named list, with the names being the map-ids. See the example
in ./inst/examples/offset_continuous.R
A modified leaflet map
If you synchronize multiple maps, a map may not yet be
initialized and therefore cannot be used. Make sure to use
addLeafletsync
after all maps have been rendered.
Other leafletsync Functions:
addLeafletsyncDependency()
,
isSynced()
,
leafletsyncOptions()
,
unsync()