The code:
require(gWidgetsWWW, quietly=TRUE)
w = gwindow("Test of widgets")
g = ggroup(cont = w, horizontal = FALSE)
glabel("How big is Central Park? Click around perimeter to see.", cont=g)
gmap = ggooglemaps(x = "Central Park New York, NY", title =
"Central Park, New York, NY", cont = g)
gmap$setZoom(13)
addHandlerClicked(gmap, handler = function(h,...) {
gmap$addMarker(h$latlng)
})
b = gbutton("draw polygon", cont = g, handler = function(h,...) {
gmap$addPolygon()
})
## print out
w
## Example of ggooglemaps
require(gWidgetsWWW, quietly=TRUE)
w = gwindow("Test of widgets")
g = ggroup(cont = w, horizontal = FALSE)
glabel("How big is Central Park? Click around perimeter to see.", cont=g)
gmap = ggooglemaps(x = "Central Park New York, NY", title =
"Central Park, New York, NY", cont = g)
gmap$setZoom(13)
addHandlerClicked(gmap, handler = function(h,...) {
gmap$addMarker(h$latlng)
})
b = gbutton("draw polygon", cont = g, handler = function(h,...) {
gmap$addPolygon()
})
## print out
w