# NOT RUN {
## use the properties inside the geoJSON to style each feature
google_map(key = map_key) %>%
add_geojson(data = geo_melbourne)
## use a JSON string to style all features
style <- '{ "fillColor" : "green" , "strokeColor" : "black", "strokeWeight" : 0.5}'
google_map(key = map_key) %>%
add_geojson(data = geo_melbourne, style = style)
## use a named list to style all features
style <- list(fillColor = "red" , strokeColor = "blue", strokeWeight = 0.5)
google_map(key = map_key) %>%
add_geojson(data = geo_melbourne, style = style)
## GeoJSON from a URL
url <- 'https://storage.googleapis.com/mapsdevsite/json/google.json'
google_map(key = map_key) %>%
add_geojson(data = url, mouse_over = T)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab