Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when include code in x argument for mapview #454

Open
see24 opened this issue May 24, 2023 · 3 comments
Open

Error when include code in x argument for mapview #454

see24 opened this issue May 24, 2023 · 3 comments

Comments

@see24
Copy link

see24 commented May 24, 2023

Seems like it is using a quoted version of the object name in a file path but that doesn't work when there is code in the argument

mapview::mapview(raster::raster(matrix(1:100)))

Error in normalizePath(path.expand(path), winslash, mustWork) :
path[1]="lib/raster::raster(matrix(1:100))_0c1be5-1": The filename, directory name, or volume label syntax is incorrect
In addition: There were 45 warnings (use warnings() to see them)

@tim-salabim
Copy link
Member

Yeah, that error message stems from the leaflet package if I am not mistaken. Did you try with leaflet?

@see24
Copy link
Author

see24 commented May 24, 2023

This worked in leaflet, in that it didn't have an error:

leaflet::leaflet()|> leaflet::addRasterImage(raster::raster(matrix(1:100), crs = "EPSG:3857"))

Could be that the error comes from leaflet but I am not familiar enough to trigger it there. You could catch it in mapview and give a more informative error message. Or maybe you can create an issue in leaflet if you know how to trigger it?

@tim-salabim
Copy link
Member

I'll try to look into it, but I don't have much time at the moment. A work around for the time being is to assign to a variable and use that in mapview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants