vecDraw | R Documentation |
vecDraw is designed for straightforward digitizing of simple geometries without adding attributes. It provides a bunch of leaflet base maps and optionally a sf* object can be loaded for orientation.
vecDraw( mapCenter = NULL, zoom = 15, line = TRUE, rectangle = TRUE, poly = TRUE, circle = TRUE, point = TRUE, remove = TRUE, position = "topright", maplayer = c("CartoDB.Positron", "OpenStreetMap", "Esri.WorldImagery", "Thunderforest.Landscape", "OpenTopoMap"), overlay = NULL, preset = "all", locPreset = "muf", cex = 10, lwd = 2, opacity = 0.7 )
mapCenter |
center of the leaflet map |
zoom |
set initial zoom level of leaflet map |
line |
enable/disable line tool |
rectangle |
enable/disable polygon tool |
poly |
enable/disable polygon tool |
circle |
enable/disable circle tool |
point |
enable/disable point tool |
remove |
enable/disable the remove feature of the draw tool |
position |
toolbar layout (topright, topleft, bottomright, bottomleft) |
maplayer |
string as provided by leaflet-provider |
overlay |
optional sp* object may used for orientation |
preset |
character default is "uav" for line based mission digitizing, "ext" for rectangles, NULL for all drawing items |
locPreset |
character location preset, default is "muf" for Marburg University Forest, "tra" Traddelstein, "hag" Hagenstein, "baw" Bayerwald. |
cex |
size of item |
lwd |
line width of item |
opacity |
opacity of item |
Yu can either save the digitized object to a json (JS) or kml (KML) file.
## Not run: # fully featured without overlay require(mapview) # preset for digitizing uav flight areas using Meuse data set as overlay require(sp) data(meuse) sp::coordinates(meuse) <- ~x+y sp::proj4string(meuse) <-CRS("+init=epsg:28992") m <- sp::spTransform(meuse,CRSobj = sp::CRS("+init=epsg:4326")) vecDraw(overlay = m, preset = "uav") # preset for digitizing simple rectangles extents vecDraw(preset="ext",overlay = m) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.