Skip to content

Commit

Permalink
fusion tables
Browse files Browse the repository at this point in the history
  • Loading branch information
David Cooley committed Jun 15, 2017
1 parent 4d91006 commit 7ef09e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/google_map_layers.R
Original file line number Diff line number Diff line change
Expand Up @@ -1765,6 +1765,13 @@ add_fusion <- function(map, query, styles = NULL, layer_id = NULL){
## add a fusion tables layer by passing a query object with the following
## - SELECT property whose value is the column name containing the location information.
## - FROM property whose value is the encrypted ID of the table

## The Google Maps API can't use values inside arrays, so we need
## to get ride of any arrays.
## - check that each key/value is a single value?
## - remove square brackets around value


query <- gsub("\\[|\\]", "", jsonlite::toJSON(query))
s <- jsonlite::toJSON(styles)
s <- gsub("\\[|\\]", "", substr(s, 2, (nchar(s) - 1)))
Expand Down
2 changes: 2 additions & 0 deletions inst/htmlwidgets/google_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ function update_style(map_id, style){
*/
function add_fusion(map_id, query, styles, layer_id){

// TODO: extend map bounds

window[map_id + 'googleFusion' + layer_id] = [];
console.log(query);
console.log(styles);
Expand Down

0 comments on commit 7ef09e2

Please sign in to comment.