leafloc: Add Leaflet map widget for point location.

Description Usage Arguments Details Value Examples

Description

Add a Leaflet map widget centered on a point to a static or interactive document or a Shiny app.

Usage

1
2
leafloc(loc, bottom = "Stamen.Watercolor", top = "Stamen.TonerLite",
  width = "100%", op = 0.5, zoom = 12)

Arguments

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 "100%".

op

numeric, opacity for bottom and top tile sets, respectively. If length-1, will be repeated.

zoom

integer, map zoom, defaults to 12.

Details

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.

Value

a Leaflet map.

Examples

1
2
leafloc("Anchorage")
leafloc(c(0, 52), zoom = 6)

leonawicz/snapplot documentation built on May 17, 2019, 1:33 p.m.