4

I've been using mapshot a lot to send interactive maps of data but recently, although I can make the maps I want with mapview, I can't save them.

Example:

map<- mapview(mapdata, zcol = "columnofinterest", burst = TRUE)

mapshot(map, url = paste0(getwd(), "/whatIwanttocallmymap.html"))

File whatIwanttocallmymap_files/PopupTable-0.0.1/popup.css not found in resource path
Error: pandoc document conversion failed with error 99

I'm afraid I've messed something up in how I get packages. folders with package names are turning up in the area I've set as my wd instead of in my library for R

Thank you for any help/suggestions you might have

TarJae
  • 72,363
  • 6
  • 19
  • 66
Sissiboon
  • 41
  • 2
  • I saw a thread where someone used : remotes::install_github("r-spatial/mapview@develop") to fix the error but It didn't work for me – Sissiboon Feb 08 '21 at 19:28
  • Try `remotes::install_github("r-spatial/mapview")` and it should work again – TimSalabim Feb 09 '21 at 07:56
  • @TimSalabim Thank you, that did move me forward but now I have a new error message:... a bit more code detail: visualf<- st_as_sf(f, coords = c("longitude", "latitude"), crs = "WGS84") fmap<- mapview(visualf, map.types = "Esri.WorldImagery", zcol = c("common_name"), burst = TRUE, legend = TRUE) error: Could not determine mime type for `fmap_files/aplekemu-0.0.1/aplekemu_layer.fgb' Error: pandoc document conversion failed with error 63 aplekemu is one of the variables in common_name Could it be because I'm using WGS84? Thank you so much for your help/time on this! – Sissiboon Feb 09 '21 at 12:02
  • 4
    before creating the map set `mapviewOptions(fgb = FALSE)`. This new rendering based on the fgb file format is super fast but unfortunately pandoc has yet to support it as a recognised mime-type. Until then setting the option is the only workaround for mapshot and any markdown based workflow. – TimSalabim Feb 09 '21 at 14:40
  • Hm, I think changing the fgb setting worked... when I call mapviewOptions() I see: global options: [...] fgb : FALSE However, I still get the same error 63 as my previous question. I don't know if it's useful but if i str(fmap): – Sissiboon Feb 11 '21 at 12:11
  • Formal class 'mapview' [package "mapview"] with 2 slots ..@ object:List of 8 .. ..$ aplekemu :Classes ‘sf’ and 'data.frame': 125 obs. of 8 variables: .. .. ..$ observed_on : chr [1:125] "2002-07-31" "2016-09-03" ... .. .. ..$ time_observed_at : chr [1:125] "" "2016-09-03 17:29:15 UTC" ... .. .. ..$ quality_grade : chr [1:125] "research" "research" ... .. .. ..$ url : chr [1:125] "http://myurl" ... .. .. ..$ scientific_name : chr [1:125] "Lithobates catesbeianus" ... Thank you again for helping me with this – Sissiboon Feb 11 '21 at 12:13
  • 1
    Getting the mime-type error means that the map was created with fgb enabled. Did you set the option before map creation or only before calling mapshot? Make sure you set the option at the beginning of your script, before you create any map. – TimSalabim Feb 11 '21 at 14:50
  • That makes sense... this was my issue, Thank you so much! Have a good day! :) – Sissiboon Feb 11 '21 at 16:23

0 Answers0