view_mapview_from_path | R Documentation |
Reads a spatial data file (.shp or .gpkg) and optionally displays it in an interactive map preview. The data is also opened in VisiData for tabular viewing.
view_mapview_from_path(path, preview = FALSE)
path |
Path to the spatial data file (.shp or .gpkg) |
preview |
Logical. If TRUE, opens an interactive map preview in the browser. Default is FALSE. |
The function performs the following steps:
Validates that the input file exists and has the correct extension (.shp or .gpkg)
Creates a temporary HTML file for the map preview in ~/.local/share/mapview/
Reads the spatial data using sf::read_sf()
If preview=TRUE, creates an interactive map using mapview and opens it in the browser
Opens the attribute data in VisiData
Returns nothing, called for side effects
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.