Skip to contents

Creating Maps

Functions to initialize Mapbox GL and MapLibre GL maps

mapboxgl()
Initialize a Mapbox GL Map
maplibre()
Initialize a Maplibre GL Map
mapboxgl_view()
Quick visualization of geometries with Mapbox GL
maplibre_view()
Quick visualization of geometries with MapLibre GL

Adding Layers

Functions to add various types of visualization layers to your map

add_layer()
Add a layer to a map from a source
add_fill_layer()
Add a fill layer to a map
add_line_layer()
Add a line layer to a map
add_circle_layer()
Add a circle layer to a Mapbox GL map
add_heatmap_layer()
Add a heatmap layer to a Mapbox GL map
add_fill_extrusion_layer()
Add a fill-extrusion layer to a Mapbox GL map
add_raster_layer()
Add a raster layer to a Mapbox GL map
add_symbol_layer()
Add a symbol layer to a map

Data Sources

Functions to add different types of data sources

add_source()
Add a GeoJSON or sf source to a Mapbox GL or Maplibre GL map
add_vector_source()
Add a vector tile source to a Mapbox GL or Maplibre GL map
add_raster_source()
Add a raster tile source to a Mapbox GL or Maplibre GL map
add_raster_dem_source()
Add a raster DEM source to a Mapbox GL or Maplibre GL map
add_image_source()
Add an image source to a Mapbox GL or Maplibre GL map
add_video_source()
Add a video source to a Mapbox GL or Maplibre GL map
add_h3j_source()
Add a hexagon source from the H3 geospatial indexing system.

Map Controls

Functions to add interactive controls to your map

add_navigation_control()
Add a navigation control to a map
add_fullscreen_control()
Add a fullscreen control to a map
add_scale_control()
Add a scale control to a map
add_layers_control()
Add a layers control to the map
add_draw_control()
Add a draw control to a map
add_geocoder_control()
Add a geocoder control to a map
add_reset_control()
Add a reset control to a map
add_geolocate_control()
Add a geolocate control to a map
add_globe_control()
Add a globe control to a map
add_control()
Add a custom control to a map
clear_controls()
Clear all controls from a Mapbox GL or Maplibre GL map in a Shiny app

Legends

Functions for adding and managing map legends with customizable styling

Markers

Functions for adding and managing markers

add_markers()
Add markers to a Mapbox GL or Maplibre GL map
clear_markers()
Clear markers from a map in a Shiny session

Styling Helpers

Functions to help with map styling and expressions

mapbox_style()
Get Mapbox Style URL
maptiler_style()
Get MapTiler Style URL
carto_style()
Get CARTO Style URL
interpolate()
Create an interpolation expression
match_expr()
Create a match expression
step_expr()
Create a step expression
get_column()
Get column or property for use in mapping
concat()
Create a concatenation expression
number_format()
Create a number formatting expression
cluster_options()
Prepare cluster options for circle layers

Data Classification

Functions for automatic data classification and choropleth styling

step_equal_interval() step_quantile() step_jenks()
Step expressions with automatic classification
interpolate_palette()
Create an interpolation expression with automatic palette and break calculation
get_legend_labels() get_legend_colors() get_breaks() print(<mapgl_classification>) print(<mapgl_continuous_scale>)
Extract information from classification and continuous scale objects

Camera and View

Functions to control map camera and viewport

fit_bounds()
Fit the map to a bounding box
fly_to()
Fly to a given view
ease_to()
Ease to a given view
jump_to()
Jump to a given view
set_view()
Set the map center and zoom level

Map Configuration

Functions to configure map appearance and behavior

set_style()
Update the style of a map
set_projection()
Set Projection for a Mapbox/Maplibre Map
set_terrain()
Set terrain properties on a map
set_fog()
Set fog on a Mapbox GL map
set_rain()
Set rain effect on a Mapbox GL map
set_snow()
Set snow effect on a Mapbox GL map
set_config_property()
Set a configuration property for a Mapbox GL map

Layer Management

Functions to modify and manage existing layers

set_filter()
Set a filter on a map layer
set_paint_property()
Set a paint property on a map layer
set_layout_property()
Set a layout property on a map layer
set_tooltip()
Set tooltip on a map layer
set_popup()
Set popup on a map layer
set_source()
Set source of a map layer
clear_layer()
Clear a layer from a map using a proxy
move_layer()
Move a layer to a different z-position

Shiny Integration

Functions for using mapgl in Shiny applications

mapboxglOutput()
Create a Mapbox GL output element for Shiny
maplibreOutput()
Create a Maplibre GL output element for Shiny
renderMapboxgl()
Render a Mapbox GL output element in Shiny
renderMaplibre()
Render a Maplibre GL output element in Shiny
mapboxgl_proxy()
Create a proxy object for a Mapbox GL map in Shiny
maplibre_proxy()
Create a proxy object for a Maplibre GL map in Shiny
mapboxglCompareOutput()
Create a Mapbox GL Compare output element for Shiny
maplibreCompareOutput()
Create a Maplibre GL Compare output element for Shiny
renderMapboxglCompare()
Render a Mapbox GL Compare output element in Shiny
renderMaplibreCompare()
Render a Maplibre GL Compare output element in Shiny
mapboxgl_compare_proxy()
Create a proxy object for a Mapbox GL Compare widget in Shiny
maplibre_compare_proxy()
Create a proxy object for a Maplibre GL Compare widget in Shiny

Advanced Features

Functions for advanced mapping features

compare()
Create a Compare widget
add_globe_minimap()
Add a Globe Minimap to a map
add_image()
Add an image to the map
get_drawn_features()
Get drawn features from the map
add_features_to_draw()
Add features to an existing draw control

Story Maps

Functions for creating scrollytelling story maps

story_map()
Create a scrollytelling story map
story_maplibre()
Create a scrollytelling story map with MapLibre
story_leaflet()
Create a scrollytelling story map with Leaflet
story_section()
Create a story section for story maps
on_section()
Observe events on story map section transitions