add_mouse_position_control: Add a mouse position control to the map

Description Usage Arguments Examples

View source: R/custom-controls.R

Description

Add a mouse position control to the map

Usage

1
2
add_mouse_position_control(map, mustache_template = NULL, pos = NULL,
  css_text = NULL)

Arguments

map

A mapboxer object.

mustache_template

A mustache template that contains the mustache tags lng and lat.

pos

The position of the control. One of top-left, top-right, bottom-right or bottom-left.

css_text

A cssText string that will modify the style of the control element.

Examples

1
2
3
4
5
6
7
map <- mapboxer(zoom = 4) %>%
  add_mouse_position_control(
    mustache_template = "<b>Lng:</b>{{lng}}, <b>Lat:</b>{{lat}}",
    pos = "bottom-left"
  )

if (interactive()) map

crazycapivara/mapboxer documentation built on Nov. 13, 2021, 3:22 a.m.