Description Usage Arguments Value Author(s) References See Also
This is a simple function that allows us to generate an input file for specifying the locations of GMarker objects to be displayed on a Google Map. Rather than creating the JavaScript code to create the GMarker objects, we create the data that is read at run/display-time and generic JavaScript code process the content and dynamically generates the markers then. This can be useful in AJAX-style setups or when the inputs change or there are many different input files, but the HTML and JavaScript remains constant.
1 | markerData(lat, long, file = character())
|
lat |
this specifies the latitude of the locations. This can be a numeric vector, or alternatively it can be a matrix or list/data.frame where the first two columns are considered to be the latitude and longitude (in that order). |
long |
a numeric vector giving the longitude of the points.
If this is not specified, the longitude is extracted from the
|
file |
a character string giving the name of the file to which the XML document should be written. If this is not specified is an empty character vector, the XML document is returned directly and can be post-processed before it is stored, or can be sent to a server in a request without being written to a file. |
If file
is empty, the result is an object of class
XMLInternalDocument
which represents the generated XML
content. Otherwise, the function creates the specified file
and returns its name.
Duncan Temple Lang
http://code.google.com/apis/maps/documentation/reference.html and http://code.google.com/apis/maps/documentation/index.html
googleMapsDoc
genericMarkerData.js
in
system.file("javascript", "genericMakerData.js", package = "R2GoogleMaps")
.
http://www.omegahat.org/R2GoogleMaps/sampleDocs/sfcabs.html
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.