Learn R Programming

mapview (version 1.1.0)

addMouseCoordinates: Add mouse coordinate information at top of map.

Description

This function adds a box displaying the current cursor location (latitude, longitude and zoom level) at the top of a rendered mapview or leaflet map. In case of mapview, this is automatically added. NOTE: The information will only render once a mouse movement has happened on the map.

Usage

addMouseCoordinates(map)

Arguments

map
a mapview or leaflet object.

Examples

Run this code
## Not run: 
# leaflet() %>% addTiles() # without mouse position info
# leaflet() %>% addTiles() %>% addMouseCoordinates() # with mouse position info
# mapview(easter.egg = TRUE) # mouse position info by default
# ## End(Not run)


Run the code above in your browser using DataLab