addMarker: Add Icons to a Map or RgoogleMap Plot

Description Usage Arguments Examples

View source: R/addMarker.R

Description

Adds a marker to a plot or map – an RgoogleMaps map object or Raster* object.

Usage

1
addMarker(longitude, latitude, color = "red", map = NULL, expansion = 1, ...)

Arguments

longitude

vector of longitudes

latitude

vector of latitudes

color

marker color: 'red', 'green', 'yellow', 'orange', or 'blue'. Also includes AQI category colors, specified 'AQI[number]' eg. 'AQI1'

map

optional RgoogleMaps map object or Raster* object

expansion

icon expansion factor. Ignored if width and height are specified.

...

arguments passed on to rasterImage

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)
addMarker(ca$meta$longitude, ca$meta$latitude, map=map)
# line map
monitor_map(ca)
addMarker(ca$meta$longitude, ca$meta$latitude, color = "blue", expansion = 1)

## End(Not run)

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