View source: R/write_functions.R
ol_map2HTML | R Documentation |
Writes Ol.Map object to HTML file.
ol_map2HTML(ol.map.obj, file.name, page.name = "ROpenLayers Map", width = NULL, height = NULL, ol.source.url = NULL, nga.olsource = FALSE, map.heading = NULL, map.note = NULL, nice.format = FALSE, IE.compatability.view = TRUE)
ol.map.obj |
Ol.Map object to be exported. |
file.name |
character output HTML file name. |
page.name |
character page title to be included in the HTML head section. |
width |
numeric or character CSS value width of map container. |
height |
numeric or character CSS value height of map container. |
ol.source.url |
character string containing the url to the OpenLayers
javascript library. Ignored if nga.olsource is |
nga.olsource |
logical. |
map.heading |
character heading to be placed over map in html h1 tag. |
map.note |
character note placed in html paragraph (<p>) tag centered under map container. |
nice.format |
logical. If |
IE.compatability.view |
logical. If |
Ol.Map object is written to HTML file with embedded javascript. The file
will include or source the OpenLayers javascript library as specified
in the Ol.Map object (see ol_map
).
The Javascript will call any REST APIs required for each layer in order to
produce an output file with supporting images, if required, that can
be placed directly into a directory hosted by a minimal http server.
ol_map
,
ol_map2Strings
,
mymap <- ol_map() base.layer <- lightgray() mymap <- mymap + base.layer ## Not run: # The following writes HTML and needed images ol_map2HTML(mymap,"SanDiego.html", nice.format=TRUE) # Open in browser browseURL("SanDiego.html") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.