Learn R Programming

bReeze (version 0.3-2)

plotMap: Plot map or satellite image

Description

Plots a map or satellite image of the met mast location.

Usage

plotMap(mast, type=c("satellite", "terrain", "hybrid", "roadmap"), 
  zoom, label, ...)
map(mast, type=c("satellite", "terrain", "hybrid", "roadmap"), 
  zoom, label, ...)

Arguments

mast
Met mast object created by createMast.
type
Type of the map as string. One of "satellite" (satellite image), "terrain" (map with terrain information), "hybrid" (satellite image with map overlay) or "roadmap" (map).
zoom
Zoom level as integer from 1 (small scale) up to 18 (large scale) -- default is 15.
label
Label to be placed next to the location symbol as string. Set to NA to leave the label blank. If ignored, the location coordinates are used as label default.
...
Optional graphical parameters, see below for details.

encoding

UTF-8

Optional graphical parameters

The following graphical parameters can optionally be added to customize the plot:
  • cex: Numeric value, giving the amount by which location symbol should be scaled relative to the default (which is1.5).
  • col: The colour of the symbol.
  • pch: Location symbol, either as integer or as single character. Seepointsfor possible values and their interpretation -- default is8.
  • cex.lab: Numeric value, giving the amount by which the label should be scaled relative to the default (which is1).
  • col.lab: The colour of the label -- default is same ascol.
  • pos.lab: Position specifier for the label. One of1(below symbol),2(left of symbol),3(above symbol) or4(right of symbol) -- default is4.

Details

This function is based on the RgoogleMaps package by Markus Loecher, which uses the Google Static Maps API.

See Also

createMast

Examples

Run this code
# load and prepare data
data(winddata)
set1 <- createSet(height=40, v.avg=winddata[,2])
ts <- formatTS(winddata[,1])
neubuerg <- createMast(time.stamp=ts, set1, loc=c(49.8909,11.4017))

# plot satellite image
plotMap(neubuerg)

# plot terrain map
plotMap(neubuerg, type="terrain")

# change zoom level
plotMap(neubuerg, zoom=1)
plotMap(neubuerg, zoom=18)

# change symbol (and label) 
plotMap(neubuerg, col="white", pch="+", cex=2)

# change label
plotMap(neubuerg, col.lab=3, cex.lab=1.5)
plotMap(neubuerg, pos.lab=1)
plotMap(neubuerg, label="Site #247 - Neubuerg")  # custom label
plotMap(neubuerg, label=NA)  # no label

Run the code above in your browser using DataLab