EVOLUTION-MANAGER
Edit File: map-methods.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Methods to manipulate the map widget</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for setView {leaflet}"><tr><td>setView {leaflet}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Methods to manipulate the map widget</h2> <h3>Description</h3> <p>A series of methods to manipulate the map. </p> <h3>Usage</h3> <pre> 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) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>map</code></td> <td> <p>a map widget object created from <code><a href="leaflet.html">leaflet</a>()</code></p> </td></tr> <tr valign="top"><td><code>lng</code></td> <td> <p>The longitude of the map center</p> </td></tr> <tr valign="top"><td><code>lat</code></td> <td> <p>The latitude of the map center</p> </td></tr> <tr valign="top"><td><code>zoom</code></td> <td> <p>the zoom level</p> </td></tr> <tr valign="top"><td><code>options</code></td> <td> <p>a list of zoom/pan options (see <a href="http://leafletjs.com/reference-1.3.1.html#zoom/pan-options">http://leafletjs.com/reference-1.3.1.html#zoom/pan-options</a>)</p> </td></tr> <tr valign="top"><td><code>lng1, lat1, lng2, lat2</code></td> <td> <p>the coordinates of the map bounds</p> </td></tr> </table> <h3>Value</h3> <p>The modified map widget. </p> <h3>Functions</h3> <ul> <li> <p><code>setView</code>: Set the view of the map (center and zoom level) </p> </li> <li> <p><code>flyTo</code>: Flys to a given location/zoom-level using smooth pan-zoom. </p> </li> <li> <p><code>fitBounds</code>: Set the bounds of a map </p> </li> <li> <p><code>flyToBounds</code>: Flys to given bound using smooth pan/zoom. </p> </li> <li> <p><code>setMaxBounds</code>: Restricts the map view to the given bounds </p> </li> <li> <p><code>clearBounds</code>: Clear the bounds of a map, and the bounds will be automatically determined from latitudes and longitudes of the map elements if available (otherwise the full world view is used) </p> </li></ul> <h3>References</h3> <p><a href="http://leafletjs.com/reference-1.3.1.html#map-methods-for-modifying-map-state">http://leafletjs.com/reference-1.3.1.html#map-methods-for-modifying-map-state</a> </p> <h3>Examples</h3> <pre> m <- leaflet() %>% addTiles() %>% setView(-71.0382679, 42.3489054, zoom = 18) m # the RStudio 'headquarter' m %>% fitBounds(-72, 40, -70, 43) m %>% clearBounds() # world view </pre> <hr /><div style="text-align: center;">[Package <em>leaflet</em> version 2.0.3 <a href="00Index.html">Index</a>]</div> </body></html>