prep_overlay_markers: Prepare overlay markers for use in a Mapbox static map

prep_overlay_markersR Documentation

Prepare overlay markers for use in a Mapbox static map

Description

Markers are prepared to match GeoJSON marker-spec which is a partial implementation of the GeoJSON simplestyle-spec (described as a work-in-progress by Mapbox).

Usage

prep_overlay_markers(
  data = NULL,
  marker_type = c("pin-s", "pin-l", "url"),
  label = NA,
  color = NA,
  longitude = NULL,
  latitude = NULL,
  url = NA
)

Arguments

data

An input data frame with longitude and latitude columns (X and Y or lon and lat as names are also acceptable) or an sf object with geometry type POINT.

marker_type

The marker type; one of "pin-s", for a small pin; "pin-l", for a large pin; and "url", for an image path. If marker_type is the same length as the rows in data, a mix of different marker types are allowed.

label

The marker label (optional). Can be a letter, number (0 through 99), or a valid Maki icon (see https://labs.mapbox.com/maki-icons/) for options).

color

The marker color (optional). color can be specified as a color name or as a three or six-digit hexadecimal code (with or without the number sign).

longitude

A vector of longitudes; inferred from the input dataset if data is provided.

latitude

A vector of latitudes; inferred from the input dataset if data is provided.

url

The URL of the image to be used for the icon if marker_type = "url".

Value

A formatted list of marker specifications that can be passed to the static_mapbox function.


walkerke/mapboxapi documentation built on Sept. 26, 2024, 6:26 p.m.