Skip to content

Commit

Permalink
CRAN ready
Browse files Browse the repository at this point in the history
  • Loading branch information
symbolixau committed Apr 29, 2018
1 parent 704c017 commit df4afe4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 108 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Package: googleway
Type: Package
Title: Accesses Google Maps APIs to Retrieve Data and Plot Maps
Version: 2.5.00006
Date: 2018-02-01
Version: 2.6
Date: 2018-04-29
Authors@R: c(
person("David", "Cooley", ,"[email protected]", role = c("aut", "cre")),
person("Paulo", "Barcelos", role = "ctb", comment = "Author of c++ decode_pl"),
person("Rstudio", role = "ctb", comment = "Functions written for the Leaflet pacakge")
)
Description: Provides a mechanism to plot a Google Map from R and overlay
it with shapes and markers. Also provides access to Google Maps APIs,
Description: Provides a mechanism to plot a 'Google Map' from 'R' and overlay
it with shapes and markers. Also provides access to 'Google Maps' APIs,
including places, directions, roads, distances, geocoding, elevation and
timezone.
License: GPL-3
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Version 2.5.0 (development)
## Version 2.6.0

# `clear_bounds()` function to clear the map bounds object
* `add_ ()` functions gain `focus_layer` argument to re-centre the map on the layer being plotted
Expand Down
92 changes: 0 additions & 92 deletions R/scratch.R
Original file line number Diff line number Diff line change
@@ -1,92 +0,0 @@


## TODO:
## TESTS
## - polylines - works with and without ID, for polyline and lat/lon columns
## - polygons - ditto


## two maps with the same layer_id ?


# library(shiny)
# library(shinydashboard)
# library(googleway)
#
# ui <- dashboardPage(
#
# dashboardHeader(),
# dashboardSidebar(),
# dashboardBody(
# box(width = 6,
# google_mapOutput(outputId = "map")
# ),
# box(width = 6,
# google_mapOutput(outputId = "pano")
# )
# )
# )
#
# server <- function(input, output) {
# set_key(read.dcf("~/Documents/.googleAPI", fields = "GOOGLE_MAP_KEY"))
#
# output$map <- renderGoogle_map({
# google_map(location = c(-37.817386, 144.967463),
# zoom = 14,
# split_view = "pano",
# split_view_options = list(heading = 275, pitch = 20)
# )
# })
# }
#
# shinyApp(ui, server)


#
# flinders <- "dhyeFezxsZnDwAP~@ZfCL|AQDc@eEMu@KDp@jFALMBu@_GKDx@~FMBaAyFKF~@xFMDC?cAwFEBdAxFQDeAuFIB`ArFSD"
# markers <- data.frame(
# lat = c(-37.81821,-37.8181,-37.81801,-37.81793,-37.81808,-37.81816,-37.81825,-37.81837,-37.81850,-37.81838,-37.81829,-37.81819,-37.81837,-37.81846,-37.81852,-37.81863,-37.81875,-37.81865,-37.81858,-37.81852),
# lon = c( 144.9656, 144.966, 144.9664, 144.9667, 144.9668, 144.9664, 144.9661, 144.9657, 144.9657, 144.9662, 144.9665, 144.9669, 144.9669, 144.9666, 144.9663, 144.9658, 144.9658, 144.9663, 144.9666, 144.9670)
# )
#
# ## simulate data every 6/10/60 seconds within the polygons / close to markers?
# m <- as.matrix(googlePolylines::decode(flinders)[[1]])
# m <- rbind(m, m[1,])
# m <- m[,c(2,1)]
# sf_flinders <- sf::st_polygon(x = list(m))
#
# library(shiny)
# library(shinydashboard)
# library(googleway)
#
# ui <- dashboardPage(
# dashboardHeader(),
# dashboardSidebar(),
# dashboardBody(
# google_mapOutput(outputId = "map", height = "800px"),
# actionButton(inputId = "circles", label = "add circles")
# )
# )
#
# server <- function(input, output) {
#
# set_key(read.dcf("~/Documents/.googleAPI", fields = "GOOGLE_MAP_KEY"))
# autoInvalidate <- reactiveTimer(10000)
#
# output$map <- renderGoogle_map({
# google_map()
# })
#
# observe({
# autoInvalidate()
# pts <- sf::st_sf(geometry = sf::st_sample(sf_flinders, 500))
# google_map_update(map_id = "map") %>%
# clear_circles() %>%
# add_circles(pts, radius = 1, stroke_weight = 0, update_map_view = F)
# })
# }
# shinyApp(ui, server)




4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Provides a mechanism to access various [Google Maps APIs](https://developers.goo

![Google Maps](./vignettes/img/polygon_legend.png)

## v2.4.0
## v2.6

see [News](https://github.com/SymbolixAU/googleway/blob/master/NEWS.md) for a full list of changes and additions

Expand All @@ -29,7 +29,7 @@ For specific examples, see the blog posts for

See the [**vignette**](https://github.com/SymbolixAU/googleway/blob/master/vignettes/googleway-vignette.Rmd) for instructions and examples.

## v2.5.0 (development)
## v2.7.0 (development)



Expand Down
8 changes: 3 additions & 5 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@

## Release summary

* Updates v2.2.0 to v2.4.0
* Support for `sf` objects
* Colours & legends
* Added extra Google Map API calls
* Updates v2.4.0 to v2.6.0
# Removed all source / C++ code


## Test Environments

* local OS X 10.13.2 (Sierra) install, R 3.4.0
* local OS X 15.6.0 (High Sierra) install, R 3.4.4
* ubuntu 12.04.5 (on travis-ci), R 3.3.0
* win-builder (devel and release)

Expand Down
6 changes: 2 additions & 4 deletions tests/testthat/test-google_map_layer_sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ test_that("sf objects encoded", {

testthat::skip_on_cran()
testthat::skip_on_travis()

library(sf)
testthat::skip_if_not_installed(pkg = "sf")

df <- data.frame(myId = c(1,1,1,1,1,1,1,1,2,2,2,2),
lineId = c(1,1,1,1,2,2,2,2,1,1,1,2),
Expand Down Expand Up @@ -48,8 +47,8 @@ test_that("correct sf rows are returned", {

testthat::skip_on_cran()
testthat::skip_on_travis()
testthat::skip_if_not_installed(pkg = "sf")

library(sf)
df <- data.frame(myId = c(1,1,1,1,1,1,1,1,2,2,2,2),
lineId = c(1,1,1,1,2,2,2,2,1,1,1,2),
lon = c(-80.190, -66.118, -64.757, -80.190, -70.579, -67.514, -66.668, -70.579, -70, -49, -51, -70),
Expand All @@ -75,7 +74,6 @@ test_that("correct sf rows are returned", {
sf::st_sf(geometry = multipoint)
)


expect_true(nrow(googleway:::normaliseSfData(sf, "POLYGON")) == 2)
expect_true(nrow(googleway:::normaliseSfData(sf, "LINE")) == 2)
expect_true(nrow(googleway:::normaliseSfData(sf, "POINT")) == 2)
Expand Down

0 comments on commit df4afe4

Please sign in to comment.