Skip to content

Commit

Permalink
callback parameter for #271
Browse files Browse the repository at this point in the history
  • Loading branch information
dcooley committed Mar 19, 2024
1 parent f5fee5f commit b9413fb
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 33 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Imports:
scales,
grDevices,
googlePolylines (>= 0.7.1)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
BugReports: https://github.com/SymbolixAU/googleway/issues
Suggests:
knitr,
Expand Down
14 changes: 9 additions & 5 deletions R/google_map.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ google_map <- function(data = NULL,
rotate_control = TRUE,
fullscreen_control = TRUE,
libraries = NULL,
callback = NULL,
split_view = NULL,
split_view_options = NULL,
geolocation = FALSE,
Expand Down Expand Up @@ -155,14 +156,17 @@ google_map <- function(data = NULL,

split_view_options <- splitViewOptions(split_view_options)

if(is.null(libraries))
if(is.null(libraries)) {
libraries <- c("visualization", "geometry", "places", "drawing")
}

if(is.null(location))
location <- c(0, 0) ## Melbourne, Australia
if(is.null(location)) {
location <- c(0, 0)
}

if(is.null(zoom))
if(is.null(zoom)) {
zoom <- 1
}

# forward options using x
x = list(
Expand Down Expand Up @@ -211,7 +215,7 @@ google_map <- function(data = NULL,

## CHARTS2
header <- paste0('<script src="https://maps.googleapis.com/maps/api/js?key=',
key, '&libraries=', paste0(libraries, collapse = ","), '"></script>',
key, '&libraries=', paste0(libraries, collapse = ","), if(!is.null(callback)) {paste0("&callback=", callback)}, '"></script>',
'<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>')

googlemap$dependencies <- c(
Expand Down
50 changes: 25 additions & 25 deletions man/access_result.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/clear.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/google_map.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b9413fb

Please sign in to comment.