Description Usage Arguments Value Author(s) References See Also
This function creates JavaScript code that
will create GLatLon
objects when the map
is viewed in a browser. These represent a geographical
position and are used in various places.
We use them to create (poly)lines to draw paths
and for specifying the location of a marker on a map.
1 2 3 | latLong(lat, long, digits = 4,
fmt = sprintf("%%.%df", as.integer(digits)),
prefix = "\t", collapse = ",\n")
|
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
|
digits |
the number of digits after the decimal place used to represent the numbers in the JavaScript code |
fmt |
a character string used to map an individual number to JavaScript form. This is typically not specified in a call but does allow an advanced user to control the way numbers are presented to the JavaScript interpreter. |
prefix |
a character string used as a prefix before each
generated call to |
collapse |
a character string or logical value.
If this is |
Depending on whether collapse
is a string or FALSE
,
the result is either a single character string containing the JavaScript
code to create all the GLatLon objects, or
a character vector with an element for each latitude and longitude
pair.
Duncan Temple Lang
http://code.google.com/apis/maps/documentation/reference.html and http://code.google.com/apis/maps/documentation/index.html
gpolyline
gmarker
addOverlay
googleMapsDoc
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.