tests/testthat/test-leaflet.R

context("Leaflet fitBBox")

library("leaflet")

m <- leaflet()

lng1 <- 8
lat1 <- 49
lng2 <- 9
lat2 <- 50

test_that("Equivalent to fitBounds", {
  expect_identical(fitBBox(m, c(lng1, lat1, lng2, lat2)),
                   fitBounds(m, lng1, lat1, lng2, lat2))
})

test_that("Returns unaltered map when no bbox provided", {
  expect_identical(fitBBox(m, NULL), m)
})

Try the openrouteservice package in your browser

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

openrouteservice documentation built on Oct. 21, 2024, 9:06 a.m.