Skip to content

The rest of all possible options for map elements and layers that are not listed in the layer functions.

Usage

tileOptions(
  minZoom = 0,
  maxZoom = 18,
  maxNativeZoom = NULL,
  tileSize = 256,
  subdomains = "abc",
  errorTileUrl = "",
  tms = FALSE,
  noWrap = FALSE,
  zoomOffset = 0,
  zoomReverse = FALSE,
  opacity = 1,
  zIndex = 1,
  unloadInvisibleTiles = NULL,
  updateWhenIdle = NULL,
  detectRetina = FALSE,
  ...
)

gridOptions(
  tileSize = 256,
  updateWhenIdle = NULL,
  zIndex = 1,
  minZoom = 0,
  maxZoom = NULL,
  ...
)

WMSTileOptions(
  styles = "",
  format = "image/jpeg",
  transparent = FALSE,
  version = "1.1.1",
  crs = NULL,
  ...
)

popupOptions(
  maxWidth = 300,
  minWidth = 50,
  maxHeight = NULL,
  autoPan = TRUE,
  keepInView = FALSE,
  closeButton = TRUE,
  zoomAnimation = NULL,
  closeOnClick = NULL,
  className = "",
  ...
)

labelOptions(
  interactive = FALSE,
  clickable = NULL,
  noHide = NULL,
  permanent = FALSE,
  className = "",
  direction = "auto",
  offset = c(0, 0),
  opacity = 1,
  textsize = "10px",
  textOnly = FALSE,
  style = NULL,
  zoomAnimation = NULL,
  sticky = TRUE,
  ...
)

markerOptions(
  interactive = TRUE,
  clickable = NULL,
  draggable = FALSE,
  keyboard = TRUE,
  title = "",
  alt = "",
  zIndexOffset = 0,
  opacity = 1,
  riseOnHover = FALSE,
  riseOffset = 250,
  ...
)

markerClusterOptions(
  showCoverageOnHover = TRUE,
  zoomToBoundsOnClick = TRUE,
  spiderfyOnMaxZoom = TRUE,
  removeOutsideVisibleBounds = TRUE,
  spiderLegPolylineOptions = list(weight = 1.5, color = "#222", opacity = 0.5),
  freezeAtZoom = FALSE,
  ...
)

pathOptions(
  lineCap = NULL,
  lineJoin = NULL,
  clickable = NULL,
  interactive = TRUE,
  pointerEvents = NULL,
  className = "",
  ...
)

Arguments

minZoom, maxZoom, maxNativeZoom, tileSize, subdomains, errorTileUrl, tms, noWrap, zoomOffset, zoomReverse, zIndex, unloadInvisibleTiles, updateWhenIdle, detectRetina

the tile layer options; see https://web.archive.org/web/20220702182250/https://leafletjs.com/reference-1.3.4.html#tilelayer

opacity

Tooltip container opacity. Ranges from 0 to 1. Default value is 1 (different from leaflet.js 0.9); see https://web.archive.org/web/20220702182250/https://leafletjs.com/reference-1.3.4.html#tooltip-opacity

...

extra options passed to underlying JavaScript object constructor.

styles

comma-separated list of WMS styles

format

WMS image format (use "image/png" for layers with transparency)

transparent

if TRUE, the WMS service will return images with transparency

version

version of the WMS service to use

crs

Coordinate Reference System to use for the WMS requests, defaults.

maxWidth, minWidth, maxHeight, autoPan, keepInView, closeButton, closeOnClick

popup options; see https://web.archive.org/web/20220702182250/https://leafletjs.com/reference-1.3.4.html#popup-option

zoomAnimation

deprecated. See https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md#api-changes-5

className

a CSS class name set on an element

interactive

whether the element emits mouse events

clickable

DEPRECATED! Use the interactive argument.

noHide, direction, offset, permanent

label options; see https://web.archive.org/web/20220702182250/https://leafletjs.com/reference-1.3.4.html#tooltip-option

textsize

Change the text size of a single tooltip

textOnly

Display only the text, no regular surrounding box.

style

list of css style to be added to the tooltip

sticky

If true, the tooltip will follow the mouse instead of being fixed at the feature center. Default value is TRUE (different from leaflet.js FALSE); see https://web.archive.org/web/20220702182250/https://leafletjs.com/reference-1.3.4.html#tooltip-sticky

draggable, keyboard, title, alt, zIndexOffset, riseOnHover, riseOffset

marker options; see https://web.archive.org/web/20220702182250/https://leafletjs.com/reference-1.3.4.html#marker-option

showCoverageOnHover

when you mouse over a cluster it shows the bounds of its markers

zoomToBoundsOnClick

when you click a cluster we zoom to its bounds

spiderfyOnMaxZoom

when you click a cluster at the bottom zoom level we spiderfy it so you can see all of its markers

removeOutsideVisibleBounds

clusters and markers too far from the viewport are removed from the map for performance

spiderLegPolylineOptions

Allows you to specify PolylineOptions to style spider legs. By default, they are {weight: 1.5, color: "#222", opacity: 0.5 }.

freezeAtZoom

Allows you to freeze cluster expansion to a zoom level. Can be a zoom level e.g., 10, 12 or "max" or "maxKeepSpiderify". See https://github.com/ghybs/Leaflet.MarkerCluster.Freezable#api-reference.

lineCap

a string that defines shape to be used at the end of the stroke.

lineJoin

a string that defines shape to be used at the corners of the stroke.

pointerEvents

sets the pointer-events attribute on the path if SVG backend is used

Functions

  • tileOptions(): Options for tile layers

  • gridOptions(): Options for grid layers

  • WMSTileOptions(): Options for WMS tile layers

  • popupOptions(): Options for popups

  • labelOptions(): Options for labels

  • markerOptions(): Options for markers

  • markerClusterOptions(): Options for marker clusters

  • pathOptions(): Options for vector layers (polylines, polygons, rectangles, and circles, etc)

See also

leafletCRS() to map CRS (don't change this if you're not sure what it means)