addIcon: Add Icons to a Map or RgoogleMap Plot

Description Usage Arguments Note Examples

View source: R/addIcon.R

Description

Adds an icon to map – an RgoogleMaps map object. The following icons are available:

You can use other .png files as icons by passing an absolute path as the icon argument.

Usage

1
addIcon(icon, longitude, latitude, map = NULL, expansion = 0.1, pos = 0)

Arguments

icon

object to be plotted

longitude

vector of longitudes

latitude

vector of latitudes

map

optional RgoogleMaps map object

expansion

icon expansion factor

pos

position of icon relative to location (0=center, 1=bottom, 2=left, 3=top,4=right)

Note

For RgoogleMaps, the expansion will be ~ 0.1 while for basic plots it may need to be much smaller, perhaps ~ 0.001.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
ca <- loadLatest() %>% monitor_subset(stateCodes='CA')
# Google map
map <- monitor_esriMap(ca)
addIcon("orangeFlame", ca$meta$longitude, ca$meta$latitude, map=map, expansion=0.1)
# line map
monitor_map(ca)
addIcon("orangeFlame", ca$meta$longitude, ca$meta$latitude, expansion=0.002)

## End(Not run)

PWFSLSmoke documentation built on July 8, 2020, 7:19 p.m.