Learn R Programming

plotGoogleMaps (version 1.3)

bubbleGoogleMaps: Create a bubble plot of spatial data on Google Maps

Description

Plot htm output with Google Maps API in form of bubble plot of spatial data, with options for bicolour residual plots. Ready to use as local htm file or into your own website.

Usage

bubbleGoogleMaps(SP, 
                        filename = '',
                        zcol = 1, 
                        max.radius = 100, 
                        key.entries = quantile(SP@data[, zcol], (1:5)/5), 
                        do.sqrt = TRUE, 
                        add = FALSE, 
                        previousMap = NULL, 
                        colPalette = NULL, 
                        strokeColor = '#FFAA00',
                        strokeOpacity = 1, 
                        strokeWeight = 1, 
                        geodesic = TRUE, 
                        clickable = TRUE, 
                        zIndex = 'null', 
                        shape = 'c', 
                        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, segmentGoogleMaps

Examples

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

m<-bubbleGoogleMaps(meuse,zcol='zinc',filename='myMap.htm')

m<-bubbleGoogleMaps(meuse,zcol='cadmium',filename='myMapCadmium.htm',layerName='Bubble plot - meuse',colPalette=terrain.colors(5),strokeColor='')
# see results in your working directory

Run the code above in your browser using DataLab