R/initpkg.R

Defines functions .onDetach .onAttach .onUnload .onLoad

.onLoad = function(libname, pkgname) {
  if (useFgb()) {
    mapviewOptions(fgb = TRUE)
  }
}

.onUnload = function(libpath) {
  mapview::stopWatching()
}

.onAttach = function(libname, pkgname) {
  msg = sprintf(
    "GDAL version >= 3.1.0 | setting mapviewOptions(fgb = TRUE)"
  )
  if (useFgb()) {
    packageStartupMessage(msg)
    mapviewOptions(fgb = TRUE)
  }
}

.onDetach = function(libpath) {
  mapview::stopWatching()
}

Try the mapview package in your browser

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

mapview documentation built on Oct. 13, 2023, 5:11 p.m.