map-methods: Methods to manipulate the map widget

Description Usage Arguments Value Functions References Examples

Description

A series of methods to manipulate the map.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
setView(map, lng, lat, zoom, options = list())

flyTo(map, lng, lat, zoom, options = list())

fitBounds(map, lng1, lat1, lng2, lat2, options = list())

flyToBounds(map, lng1, lat1, lng2, lat2, options = list())

setMaxBounds(map, lng1, lat1, lng2, lat2)

clearBounds(map)

Arguments

map

a map widget object created from leaflet()

lng

The longitude of the map center

lat

The latitude of the map center

zoom

the zoom level

options

a list of zoom/pan options (see http://leafletjs.com/reference-1.3.1.html#zoom/pan-options)

lng1, lat1, lng2, lat2

the coordinates of the map bounds

Value

The modified map widget.

Functions

References

http://leafletjs.com/reference-1.3.1.html#map-methods-for-modifying-map-state

Examples

1
2
3
4
m <- leaflet() %>% addTiles() %>% setView(-71.0382679, 42.3489054, zoom = 18)
m  # the RStudio 'headquarter'
m %>% fitBounds(-72, 40, -70, 43)
m %>% clearBounds()  # world view

leaflet documentation built on April 21, 2018, 1:04 a.m.