overlay_sources: Add sources to dynamic map

Description Usage Arguments Examples

View source: R/plot.R

Description

Add sources to dynamic map

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
overlay_sources(
  myplot,
  lon,
  lat,
  icon_url = NULL,
  icon_width = 20,
  icon_height = 20,
  icon_anchor_x = 10,
  icon_anchor_y = 10
)

Arguments

myplot

dynamic map produced by plot_map() function.

lon, lat

longitude and latitude of sources.

icon_url

what image to use for the icon.

icon_width, icon_height

the width and height of the icon.

icon_anchor_x, icon_anchor_y

the coordinates of the "tip" of the icon (relative to its top left corner, i.e. the top left corner means icon_anchor_x = 0 and icon_anchor_y = 0), and the icon will be aligned so that this point is at the marker's geographical location.

Examples

1
2
3
4
5
6
source_locations <- mysim$record$true_source
plot1 <- plot_map()
plot1 <- overlay_sources(myplot = plot1,
                         lon = source_locations$longitude,
                         lat = source_locations$latitude)
plot1

Michael-Stevens-27/silverblaze documentation built on May 28, 2021, 5:47 p.m.