Description Usage Arguments Value Examples
Plot a 'location' object to a leaflet widget
1 | plot2leaflet(theObject, popup = "NotDefined")
|
theObject |
A location. |
A leaflet object.
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.