Plot an invisible layer with the extent of a spatial object.
ghostLayer(x, bg)
x | an sf object, a simple feature collection or a Spatial*DataFrame. |
---|---|
bg | background color. |
#> Reading layer `mtq' from data source #> `/tmp/RtmppBiN3A/temp_libpath43d97684eada/cartography/gpkg/mtq.gpkg' #> using driver `GPKG' #> Simple feature collection with 34 features and 7 fields #> Geometry type: MULTIPOLYGON #> Dimension: XY #> Bounding box: xmin: 690574 ymin: 1592536 xmax: 735940.2 ymax: 1645660 #> Projected CRS: WGS 84 / UTM zone 20Ntarget <- mtq[30,] ghostLayer(target, bg = "lightblue")# overly complicated label placement trick: labelLayer(x = suppressWarnings(st_intersection(mtq, st_buffer(target, 2000))), txt = "LIBGEO", halo = TRUE, cex = .9, r = .14, font = 2, bg = "grey20", col= "white")