# NOT RUN {
map_key <- 'your_api_key'
qry <- data.frame(select = 'address',
from = '1d7qpn60tAvG4LEg4jvClZbc1ggp8fIGGvpMGzA',
where = 'ridership > 200')
google_map(key = map_key, location = c(41.8, -87.7), zoom = 9) %>%
add_fusion(query = qry)
qry <- list(select = 'address',
from = '1d7qpn60tAvG4LEg4jvClZbc1ggp8fIGGvpMGzA',
where = 'ridership > 200')
google_map(key = map_key, location = c(41.8, -87.7), zoom = 9) %>%
add_fusion(query = qry)
qry <- data.frame(select = 'geometry',
from = '1ertEwm-1bMBhpEwHhtNYT47HQ9k2ki_6sRa-UQ')
styles <- list(
list(
polygonOptions = list( fillColor = "#00FF00", fillOpacity = 0.3)
),
list(
where = "birds > 300",
polygonOptions = list( fillColor = "#0000FF" )
),
list(
where = "population > 5",
polygonOptions = list( fillOpacity = 1.0 )
)
)
google_map(key = map_key, location = c(-25.3, 133), zoom = 4) %>%
add_fusion(query = qry, styles = styles)
qry <- '{"select":"geometry","from":"1ertEwm-1bMBhpEwHhtNYT47HQ9k2ki_6sRa-UQ"}'
styles <- '[
{
"polygonOptions":{
"fillColor":"#FFFF00",
"fillOpacity":0.3
}
},
{
"where":"birds > 300",
"polygonOptions":{
"fillColor":"#000000"
}
},
{
"where":"population > 5",
"polygonOptions":{
"fillOpacity":1
}
}
]'
google_map(key = map_key, location = c(-25.3, 133), zoom = 4) %>%
add_fusion(query = qry, styles = styles)
## using a JSON style
attr(styles, 'class') <- 'json'
google_map(key = map_key, location = c(-25.3, 133), zoom = 4) %>%
add_fusion(query = qry, styles = styles)
qry <- data.frame(select = 'location',
from = '1xWyeuAhIFK_aED1ikkQEGmR8mINSCJO9Vq-BPQ')
google_map(key = map_key, location = c(0, 0), zoom = 1) %>%
add_fusion(query = qry, heatmap = T)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab