MapSites: Map Site Locations in Google Maps

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/MapSites.R

Description

Add site markers and polygon objects to Google Maps.

Usage

1
MapSites(sites, polygons = NULL, map.id = "map")

Arguments

sites

data.frame. Site information, see 'Details'.

polygons

gpc.poly. Polygon information

map.id

character. Unique identifier in map URL

Details

The sites data table has components of lat, lng, alt, site, name, agency, and type. Where lat and lng are the latitude and longitude based on the WGS84 datum; alt is the altitude of the site referenced to the specified vertical datum (NGVD29 or NAVD 88); site is the unique site identification number; name is the name of the site; agency is the code for the agency reporting the data; and type is the hydrologic setting of the site.

Value

Writes a JSON data file (‘.json’) to a temporary directory. An Rhttpd object is created and started in the internal web server.

Author(s)

J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center

See Also

Rhttpd-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
  s <- data.frame(lat    = c(43.5757402325, 43.5803046219, 43.8642317971),
                  lng    = c(-112.934719019, -112.876178537, -112.742880208),
                  site   = c(433433112560201, 433449112523101, 435152112443101),
                  name   = c("CPP 1", "NPR Test", "ANP 6"),
                  agency = "USGS", type = "GW", stringsAsFactors = FALSE)
  MapSites(sites = s, map.id = "map01")

  f <- system.file("extdata/ExamplePolygon.ply", package = "RNWIS")
  p <- rgeos::read.polyfile(f, nohole = FALSE)
  MapSites(sites = s, polygons = p, map.id = "map02")

## End(Not run)

jfisher-usgs/RNWIS documentation built on Aug. 26, 2020, 6:43 p.m.