Learn R Programming

⚠️There's a newer version (0.2.1) of this package.Take me there.

mapgl

The mapgl R package makes the latest versions of Mapbox GL JS and MapLibre GL JS available to R users. The package interface is designed to make the powerful capabilities of both libraries available in R mapping projects, but also feel similar to users coming from other R mapping packages.

Install from CRAN:

install.packages("mapgl")

Or, install the development version from GitHub:

remotes::install_github("walkerke/mapgl")

Read through these vignettes to learn how to use the package:

Recommended training and how to learn more

If you find this project useful in your work and would like to ensure continued development of the package, you can provide support in the following ways:

To stay on top of package updates / new features and to get information about mapgl trainings, be sure to sign up for the Walker Data mailing list here.

Copy Link

Version

Install

install.packages('mapgl')

Monthly Downloads

718

Version

0.1.3

License

MIT + file LICENSE

Maintainer

Kyle Walker

Last Published

September 4th, 2024

Functions in mapgl (0.1.3)

add_categorical_legend

Add a categorical legend to a Mapbox GL map
add_symbol_layer

Add a symbol layer to a map
add_fullscreen_control

Add a fullscreen control to a map
add_source

Add a GeoJSON or sf source to a Mapbox GL or Maplibre GL map
fit_bounds

Fit the map to a bounding box
add_scale_control

Add a scale control to a map
ease_to

Ease to a given view
match_expr

Create a match expression
add_vector_source

Add a vector tile source to a Mapbox GL or Maplibre GL map
fly_to

Fly to a given view
add_draw_control

Add a draw control to a map
add_legend

Add a legend to a Mapbox GL map
add_circle_layer

Add a circle layer to a Mapbox GL map
clear_controls

Clear all controls from a Mapbox GL or Maplibre GL map in a Shiny app
add_line_layer

Add a line layer to a map
clear_layer

Clear a layer from a map using a proxy
get_drawn_features

Get drawn features from the map
renderMapboxgl

Render a Mapbox GL output element in Shiny
add_geocoder_control

Add a geocoder control to a map
add_raster_dem_source

Add a raster DEM source to a Mapbox GL or Maplibre GL map
interpolate

Create an interpolation expression
mapbox_style

Get Mapbox Style URL
add_raster_layer

Add a raster layer to a Mapbox GL map
maplibreOutput

Create a Maplibre GL output element for Shiny
get_column

Get column or property for use in mapping
mapboxgl_proxy

Create a proxy object for a Mapbox GL map in Shiny
mapgl-package

mapgl: Interactive Maps with 'Mapbox GL JS' and 'MapLibre GL JS' in R
set_filter

Set a filter on a map layer
add_reset_control

Add a reset control to a map
add_raster_source

Add a raster tile source to a Mapbox GL or Maplibre GL map
maplibre_proxy

Create a proxy object for a Maplibre GL map in Shiny
add_layer

Add a layer to a map from a source
maptiler_style

Get MapTiler Style URL
set_fog

Set fog on a Mapbox GL map
add_layers_control

Add a layers control to the map
maplibre

Initialize a Maplibre GL Map
clear_markers

Clear markers from a map in a Shiny session
clear_legend

Clear legend from a map in a proxy session
jump_to

Jump to a given view
set_view

Set the map center and zoom level
step_expr

Create a step expression
add_video_source

Add a video source to a Mapbox GL or Maplibre GL map
renderMaplibre

Render a Maplibre GL output element in Shiny
carto_style

Get CARTO Style URL
set_style

Update the style of a map
set_terrain

Set terrain properties on a map
cluster_options

Prepare cluster options for circle layers
compare

Create a Compare slider widget
mapboxglOutput

Create a Mapbox GL output element for Shiny
mapboxgl

Initialize a Mapbox GL Map
set_layout_property

Set a layout property on a map layer
set_paint_property

Set a paint property on a map layer
set_config_property

Set a configuration property for a Mapbox GL map
add_continuous_legend

Add a continuous legend
add_fill_layer

Add a fill layer to a map
add_fill_extrusion_layer

Add a fill-extrusion layer to a Mapbox GL map
add_image_source

Add an image source to a Mapbox GL or Maplibre GL map
add_heatmap_layer

Add a heatmap layer to a Mapbox GL map
add_markers

Add markers to a Mapbox GL or Maplibre GL map
add_navigation_control

Add a navigation control to a map