Skip to contents

Opens the plot in MiRA's map mode: each layer at its coordinates on a satellite map, fitted to the layers. Clicking a location (or its name in the Select Layers panel) draws that layer's network over the map, as drawn in network mode. mira_filter() applies. In MiRA, the map button opens this view.

Usage

mira_mode_map()

Value

A component, to add to a plot with +.

Details

The map needs the layers' coordinates: latitude and longitude columns in net$layers, with both values for at least one layer. Without them R stops with an error. The map's settings (opacity, street map, which layers are drawn) are not available from R yet; the map opens with MiRA's defaults.

A plot opens in one view: see mira_mode for the rules and for what applies in each view.

Network 17 in map mode: the Galapagos, with the layers' two islands marked

Examples

library(emln)
net <- load_emln(17) # 4 layers on two islands of the Galapagos
#> Creating state node map
#> Creating extended link list with node IDs
net$layers[, c("layer_name", "latitude", "longitude")]
#> # A tibble: 4 × 3
#>   layer_name latitude longitude
#>   <chr>         <dbl>     <dbl>
#> 1 layer_1      -0.909     -89.6
#> 2 layer_2      -0.909     -89.6
#> 3 layer_3      -0.533     -90.4
#> 4 layer_4      -0.533     -90.4
p <- mira(net, bipartite = TRUE, setA_type = "bird")
#> Bipartite network: drawn as undirected. Use directed = TRUE for a directed one.
p + mira_mode_map()
#> Not opened: R is not interactive. Print the plot in an R session, or give `browser` to open it from a script.