plot2leaflet: Plot a 'location' object to a leaflet widget

Description Usage Arguments Value Examples

Description

Plot a 'location' object to a leaflet widget

Usage

1
plot2leaflet(theObject, popup = "NotDefined")

Arguments

theObject

A location.

Value

A leaflet object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
rosenbergstrasse59 <- new("location",
name = "FHSG",
street = "Rosenbergstrasse 59",
zip_code = "9001",
community = "St.Gallen",
canton = "SG",
lat = geocoder::geocode("Rosenbergstrasse 59, 9001 St.Gallen")$lat,
lng = geocoder::geocode("Rosenbergstrasse 59, 9001 St.Gallen")$lng)
map <- plot2leaflet(rosenbergstrasse59)
map

twoPlaces <- new("location",
                street = c("Rosenbergstrasse 59","Bahnhofplatz"),
                 zip_code = c("9001","9000"),
                 community = c("St.Gallen","St.Gallen"),
                 canton = c("SG","SG"),
                 lat = c(geocoder::geocode(
                   "Rosenbergstrasse 59, 9001 St.Gallen")$lat,
                   geocoder::geocode(
                     "Bahnhofplatz, 9000 St.Gallen")$lat),
                 lng = c(geocoder::geocode(
                   "Rosenbergstrasse 59, 9001 St.Gallen")$lng,
                   geocoder::geocode("Bahnhofplatz, 9000 St.Gallen")$lng)
)
map <- plot2leaflet(twoPlaces)
map

symbolrush/locationr documentation built on May 30, 2019, 10:44 p.m.