Description Usage Arguments Details Examples
Make an interactive map to view in the browser
1 2 3 |
dat |
Object of class |
popup |
If |
map_provider |
Base map to use. One or a list of 'osm' (OpenStreetMap
standard map), 'tls' (Thunderforest Landscape), 'cm' (CloudMade), 'mqosm'
(MapQuest OSM) or 'mqsat' (MapQuest Open Aerial). Default is 'osm'. See
|
zoom |
Map zoom, 0 being most zoomed out, and 18 most zoomed out. See
|
title |
Map title |
size |
Height and width (in pixels) of map as a length 2 vector. If missing, a fullscreen (browser window) map is generated. |
centerview |
Lat/long position to center map |
dest |
Specify a path to save an html file of your map. You can open this in your browser to view it. If left as NULL (the default) the map opens up in your default browser, or if you have a newer version of RStudio open in RStudio Viewer pane. |
overwrite |
Default: |
incl.data |
Default: |
NOTE that with some map_provider options you will have no map layer show up at first. This may be because there is no map at that particular zoom level. Just zoom in or out to see the map.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
library("spocc")
spp <- c('Danaus plexippus','Accipiter striatus','Pinus contorta')
dat <- occ(query = spp, from = 'gbif', gbifopts = list(hasCoordinate = TRUE), limit=50)
map_leaflet(dat, dest = ".")
# An example with more species, a different base map, and different color palette
spp <- c('Danaus plexippus','Accipiter striatus','Pinus contorta','Puma concolor',
'Ursus americanus','Gymnogyps californianus')
dat <- occ(query = spp, from = 'gbif', gbifopts = list(hasCoordinate = TRUE), limit=50)
map_leaflet(dat, map_provider = 'toner')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.