Add a Leaflet map widget centered on a point to a static or interactive document or a Shiny app.
leafloc(loc, bottom = "Stamen.Watercolor", top = "Stamen.TonerLite", width = "100%", op = 0.5, zoom = 12)
loc | character or numeric, name of available point location or specific coordinates. See details. |
---|---|
bottom | character, bottom layer provider tile set. |
top | character, top layer provider tile set. |
width | character, map widget width, defaults to |
op | numeric, opacity for bottom and top tile sets, respectively. If length-1, will be repeated. |
zoom | integer, map zoom, defaults to 12. |
a Leaflet map.
This function generates a Leaflet map centered on loc
where loc
is the string name of a point location from the snaplocs
package.
Alternatively, the function can be used more generally by providing a length-2 vector of longitude and lattitude.
This canned map widget uses two provider tile sets, each with default opacity, op = 0.5
.
leafloc("Anchorage") leafloc(c(0, 52), zoom = 6)