R/plotZ7.R

Defines functions plotZ7

Documented in plotZ7

#' Plot Z7 sites on a leaflet
#'
#' The function transforms the site ID (that consits of 6 digits) to spatial
#' data and plots them on a leaflet.
#'
#' @param coordID Vector with site coordinates
#' @param ortho Whether orthofotos should be used as background image.
#' @return A leaflet with ploted Z7 sites.
#' @export
#'
#' @examples
#' plotZ7(645260)
plotZ7 <- function(coordID, ortho = FALSE) {
  if(ortho) tilprov <- "Esri.WorldImagery"
  if(!ortho) tilprov <- "OpenStreetMap.Mapnik"
  q <- makesq(coordID, projection = "WGS")
  map <- leaflet() %>% 
    addProviderTiles(tilprov) %>% 
    addPolygons(data = q, label = as.character(coordID))
  return(map)
}
TobiasRoth/BDM documentation built on May 30, 2018, 8:02 a.m.