accessibility_mapbox {greenR} | R Documentation |
Create a dynamic Accessibility Map Using Mapbox GL JS
Description
This function creates a dynamic accessibility map using Mapbox GL JS. The map shows green areas and allows users to generate isochrones for walking times.
Usage
accessibility_mapbox(
green_area_data,
mapbox_token,
output_file = "accessibility_map.html",
initial_zoom = 15,
initial_pitch = 45,
initial_bearing = -17.6
)
Arguments
green_area_data |
A list containing green area data. |
mapbox_token |
Character, your Mapbox access token. |
output_file |
Character, the file path to save the HTML file. |
initial_zoom |
Numeric, the initial zoom level of the map. Default is 15. |
initial_pitch |
Numeric, the initial pitch of the map. Default is 45. |
initial_bearing |
Numeric, the initial bearing of the map. Default is -17.6. |
Value
NULL. The function creates an HTML file and opens it in the viewer or browser if run interactively.
Examples
if (interactive()) {
data <- get_osm_data("Basel, Switzerland")
green_areas_data <- data$green_areas
mapbox_token <- "your_mapbox_access_token_here"
accessibility_mapbox(green_areas_data, mapbox_token)
}
[Package greenR version 0.0.1.3 Index]