Learn R Programming

plotGoogleMaps (version 1.3)

segmentGoogleMaps: Create a segment circles - pie charts plot of spatial data on Google Maps, by using two or more related attributes.

Description

Plot htm output with Google Maps API in form of pie charts plot form spatial data by using two or more related attributes. Ready to use as local htm file or into your own website.

Usage

segmentGoogleMaps(SP, 
                  zcol = 1:length(SP@data), 
                  filename = '', 
                  max.radius = 100, 
                  scalelist = TRUE, 
                  do.sqrt = FALSE, 
                  add = F, 
                  previousMap = NULL, 
                  colPalette = rainbow(ncol(SP@data[, zcol])),
                   strokeColor = '#FFAA00', 
                   strokeOpacity = 1, 
                   strokeWeight = 1, 
                   fillOpacity = 0.7, 
                   geodesic = TRUE, 
                   clickable = TRUE, 
                   zIndex = 'null', 
                   map.width = '80%',
                   map.height = '100%', 
                   layerName = '', 
                   control.width = '20%', 
                   control.height = '100%', 
                   zoom = 15, 
                   fitBounds = TRUE, 
                   mapTypeId = 'HYBRID', 
                   disableDoubleClickZoom = FALSE, 
                   draggable = TRUE, 
                   keyboardShortcuts = TRUE, 
                   mapTypeControlOptions = 'DEFAULT', 
                   navigationControl = TRUE, 
                   navigationControlOptions = 'DEFAULT', 
                   scaleControlOptions = 'STANDARD', 
                   noClear = FALSE, 
                   scrollwheel = TRUE,
                   streetViewControl = FALSE)

Arguments

Value

This function returns a list with HTML, JavaScript, Google Maps API key and else what is necessary for the final web map. The second output is htm file ready to use stored in working direcoty.

See Also

plotGoogleMaps, ellipseGoogleMaps, bubbleGoogleMaps

Examples

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

m<-segmentGoogleMaps(meuse,zcol=c('zinc','lead','copper'),filename='myMap.htm')
# see results in your working directory

Run the code above in your browser using DataLab