ol_map2HTML: Export OpenLayers Map to file.

View source: R/write_functions.R

ol_map2HTMLR Documentation

Export OpenLayers Map to file.

Description

Writes Ol.Map object to HTML file.

Usage

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)

Arguments

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 TRUE.

nga.olsource

logical. TRUE will use the OpenLayers 3.16.0 javascript library from https://home.gvs.nga.mil (requires authentication); FALSE uses the sources the ol.source.url, if provided, or embeds the OpenLayers 5.3.0 JavaScript code in the HTML head. Only used if ol.source.url is missing or NULL.

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 TRUE, output file will be formated with new lines and indentation for human readability.

IE.compatability.view

logical. If TRUE, the statement
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
to the HTML document head. This statement is required for some browsers to render the map.

Details

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.

See Also

ol_map, ol_map2Strings,

Examples

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)

cemarks/ROpenLayers documentation built on March 31, 2022, 12:05 p.m.