Error message when using mapview with filtered data
This is one is really strange... It's working in a previous version of R (4.3.3) using the same mapview (2.11.2) and leaflet (2.2.2) versions but it's failing now with R 4.5. I guess it's maybe linked to other package dependencies...
library(mapview)
mapview(franconia[franconia$NUTS_ID == "DE241",])
Error: cannot open the connection In addition: Warning messages: 1: In file.create(to[okay]) : cannot create file 'C:\Users\jgu\AppData\Local\Temp\Rtmp4QKa0h\file18546cf34249/franconia[franconia$NUTS_ID == "DE241", ]_layer.fgb', reason 'Invalid argument' 2: In file(con, "w") : cannot open file 'C:\Users\jgu\AppData\Local\Temp\Rtmp4QKa0h\file18543c959b6/franconia[franconia$NUTS_ID == "DE241", ]_home-button.css': Invalid argument
It's working if I specify the layer name:
mapview(franconia[franconia$NUTS_ID == "DE241",], layer.name = "DE241")
Thanks, seems to be an issue with naming of the internally created .fgb file. It works with
library(mapview)
mapviewOptions(fgb = FALSE)
mapview(franconia[franconia$NUTS_ID == "DE241",])
I'll look into this.
Thanks! Unfortunately I'm also getting an error after setting the option fgb = FALSE
Error: cannot open the connection In addition: Warning message: In file(con, "w") : cannot open file 'C:\Users\jgu\AppData\Local\Temp\Rtmpkh5pvW\file3578791053a4/franconia[franconia$NUTS_ID == "DE241", ]_home-button.css': Invalid argument
Ok, that seems windows specific then.
I've just tested it on a mac... If fgb = TRUE, there is no error message but no feature is displayed on the map. If fgb = FALSE, then everything works fine.
Thanks! That is the same behaviour as on linux
This should work now with the latest versions of mapview and leafem (pushed to CRAN yesterday). Feel free to re-open if not fixed.
Thanks, it's working perfectly!