tests/testthat/test-google_map_layer_kml.R

context("kml")

test_that("kml layer works", {


  kmlUrl <- paste0('https://developers.google.com/maps/',
                   'documentation/javascript/examples/kml/westcampus.kml')

  g <- google_map(key = 'abc') %>%
    add_kml(kml_url = kmlUrl)

  expect_true(
    sum(class(g) == c("google_map", "htmlwidget")) == 2
  )

  g <- google_map(key = 'abc') %>%
    add_kml(kml_url = kmlUrl) %>%
    clear_kml()

  expect_true(
    g$x$calls[[2]]$functions == "clear_kml"
  )

})

Try the googleway package in your browser

Any scripts or data that you put into this service are public.

googleway documentation built on Aug. 22, 2023, 9:13 a.m.