plot_leaflet: Convenience function to quickly plot geometries on a leaflet...

View source: R/plot_leaflet.R

plot_leafletR Documentation

Convenience function to quickly plot geometries on a leaflet map.

Description

Convenience function to quickly plot geometries on a leaflet map.

Usage

plot_leaflet(
  data,
  popup = NULL,
  force = TRUE,
  colour = "#03F",
  col_group = NULL,
  n = 7,
  palette = "viridis",
  legend_pos = "topright",
  legend_title = NULL,
  opacity = 0.5,
  fill_opacity = 0.2,
  width = NULL,
  height = NULL,
  padding = 0,
  type,
  latitude = "latitude",
  longitude = "longitude",
  projection = projection_wgs84(),
  id = NA,
  ...
)

Arguments

data

Spatial object or a data frame with coordinates

popup

Vector of variables to be used as a popup on the map.

force

Should the projection be forced to WGS84? Default is TRUE.

colour

Colour of geometry.

col_group

If the colour mapped on a numeric vector, how should the colours be grouped. Default is NULL. Can be "bin" or "quantile".

n

If the col_group`` is not NULL“, how many different of colours should be plotted.

palette

Colour pallette options passed to leaflet::colorNumeric().

legend_pos

Legend position. Accepts c("topright", "bottomright", "bottomleft","topleft").

legend_title

Legend title.

opacity

Opacity of the edge of the geometry.

fill_opacity

Internal opacity of the geometry.

width

Width of the map

height

Height of the map

padding

Padding of the map

type

If data is data frame, what type of spatial object it is.

latitude, longitude

Columns for latitude and longitude

projection

The projections system

id

If the data type is not point, an id column with the groupings.

...

Other arguments passed to leaflet::addControl()

Value

Invisible, a leaflet map.

Author(s)

Stuart K. Grange, Hao Wu


MohoWu/ricardor documentation built on March 24, 2022, 4:39 p.m.