Learn R Programming

plotGoogleMaps (version 2.2)

iconlabels: Create icon markers depending on attribute data.

Description

The function provide links to icon markers or icon labels ready to use for plotGoogleMaps.

Usage

iconlabels(attribute, colPalette=NULL, at=NULL, height=10, icon=FALSE, scale=0.6 )

Arguments

attribute
vector of attribute data
colPalette
colours to be used to fill marker symbols or labels
at
values at which colours will change
height
text height in pixels
icon
if false create just labels, contrariwise create markers and labels in markers
scale
scale of marker icon

Value

See Also

plotGoogleMaps, ellipseGoogleMaps, bubbleGoogleMaps

Examples

Run this code
# Data preparation
data(meuse)
coordinates(meuse)<-~x+y
proj4string(meuse) <- CRS('+init=epsg:28992')

m<-plotGoogleMaps(meuse,zcol='zinc')

# zinc labels
ic=iconlabels(meuse$zinc, height=12)
m<-plotGoogleMaps(meuse,zcol='zinc', iconMarker=ic)

# landuse labels and markers
ic=iconlabels(meuse$landuse, height=12, colPalette=rainbow(15) )
m<-plotGoogleMaps(meuse,zcol='landuse',colPalette=rainbow(15), iconMarker=ic)

ic=iconlabels(meuse$landuse, height=12, colPalette='#9ECAE1', icon=TRUE)
m<-plotGoogleMaps(meuse,zcol='landuse',colPalette='#9ECAE1', iconMarker=ic)

Run the code above in your browser using DataLab