writeMap {rleafmap}R Documentation

Export and display the map

Description

This function combines all the elements specified by the user and write the corresponding HTML and Javascript code in a local directory.

Usage

writeMap(
  ...,
  dir = getwd(),
  prefix = "",
  width = 700,
  height = 400,
  setView = NULL,
  setZoom = NULL,
  interface = NULL,
  lightjson = FALSE,
  directView = c("viewer", "browser", "disabled"),
  leaflet.loc = "online",
  popup.style = NULL
)

Arguments

...

basemap and spl objects to embed into the map

dir

a character string giving the directory path to export the map. Default is the working directory.

prefix

a character string to add a prefix to file names. This allows multiple exportations in the same directory.

width, height

the width and height of the map, in pixels.

setView

a numeric vector of the form c(x, y) setting the initial geographical center of the map.

setZoom

a numeric value setting the initial map zoom.

interface

an ui object created with ui to customize the interface controls.

lightjson

logical. Should GeoJSON files size be reducedby supressing extra whitespace characters and rounding numeric values? Default is FALSE. This is currently not compatible with RMarkdown popups.

directView

a character string indicating if and how should the map be displayed. Default option "viewer" uses (if available) the RStudio HTML viewer to display the map, "browser" opens the map into the web browser and "disabled" disables direct display.

leaflet.loc

a character string specifying the location (directory) of the leaflet library. If set to "online" (default), the library is loaded from the leaflet official CDN and requires an internet connection.

popup.style

an optional character string of CSS to customize popups content properties (width, color, etc).


[Package rleafmap version 0.2.1 Index]