Skip to content

Commit

Permalink
fix .Rbuildignore and add color to navermap
Browse files Browse the repository at this point in the history
  • Loading branch information
dkahle committed Jan 7, 2015
1 parent 37c70f2 commit 4dec66b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
^.*\.Rproj$
^\.Rproj\.user$
^README\.Rmd$
^README-*\.png$
^README.*png$
5 changes: 4 additions & 1 deletion R/get_navermap.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
#' @seealso \url{http://dev.naver.com/openapi/apis/map/staticmap/}, \code{\link{ggmap}}
#' @export
#' @examples
#' \dontrun{
#' map <- get_navermap(key="c75a09166a38196955adee04d3a51bf8", uri="www.r-project.org")
#' ggmap(map)
#' }
get_navermap <- function(
center = c(lon = 126.9849208, lat = 37.5664519), zoom = 4,
size = c(640,640), format = c("png", "jpeg", "jpg"),
Expand Down Expand Up @@ -133,6 +135,7 @@ get_navermap <- function(
key_url <- paste0("key=", key)
uri_url <- paste0("uri=", uri)
crs_url <- paste0("crs=", crs)
color_url <- paste0("color=", color)

markers_url <-
if(!missing(markers)){
Expand All @@ -150,7 +153,7 @@ get_navermap <- function(

# format url proper
post_url <- paste(center_url,crs_url ,zoom_url, size_url, baselayer_url, overlayers_url,
format_url, markers_url, key_url, uri_url, sep = "&")
format_url, markers_url, key_url, uri_url, color_url, sep = "&")
url <- paste(base_url, post_url, sep = "")
url <- gsub("[&]+","&",url) # removes missing arguments
if(substr(url, nchar(url), nchar(url)) == "&"){ # if ends with &
Expand Down
2 changes: 2 additions & 0 deletions man/get_navermap.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ are agreeing to the Naver Maps API Terms of Service at
\url{http://dev.naver.com/openapi/apis/map/staticmap}.
}
\examples{
\dontrun{
map <- get_navermap(key="c75a09166a38196955adee04d3a51bf8", uri="www.r-project.org")
ggmap(map)
}
}
\author{
Heewon Jeon \email{madjakarta@gmail.com}
}
Expand Down

0 comments on commit 4dec66b

Please sign in to comment.