add_navigation_control: Add a navigation control to a map

View source: R/controls.R

add_navigation_controlR Documentation

Add a navigation control to a map

Description

Add a navigation control to a map

Usage

add_navigation_control(
  map,
  show_compass = TRUE,
  show_zoom = TRUE,
  visualize_pitch = FALSE,
  position = "top-right",
  orientation = "vertical"
)

Arguments

map

A map object created by the mapboxgl or maplibre functions.

show_compass

Whether to show the compass button.

show_zoom

Whether to show the zoom-in and zoom-out buttons.

visualize_pitch

Whether to visualize the pitch by rotating the X-axis of the compass.

position

The position on the map where the control will be added. Possible values are "top-left", "top-right", "bottom-left", and "bottom-right".

orientation

The orientation of the navigation control. Can be "vertical" (default) or "horizontal".

Value

The updated map object with the navigation control added.

Examples

## Not run: 
library(mapgl)

mapboxgl() |>
    add_navigation_control(visualize_pitch = TRUE)

## End(Not run)

mapgl documentation built on Nov. 1, 2024, 5:08 p.m.