add_globe_control: Add a globe control to a map

View source: R/controls.R

add_globe_controlR Documentation

Add a globe control to a map

Description

This function adds a globe control to a MapLibre GL map that allows toggling between "mercator" and "globe" projections with a single click.

Usage

add_globe_control(map, position = "top-right")

Arguments

map

A map object created by the maplibre function.

position

The position of the control. Can be one of "top-left", "top-right", "bottom-left", or "bottom-right". Default is "top-right".

Value

The modified map object with the globe control added.

Examples

## Not run: 
library(mapgl)

maplibre() |>
    add_globe_control(position = "top-right")

## End(Not run)

mapgl documentation built on June 8, 2025, 1:57 p.m.