as_mapbox_source: Convert a data object to a Mapbox GeoJSON source

Description Usage Arguments

View source: R/sources.R

Description

Convert a data object to a Mapbox GeoJSON source

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
as_mapbox_source(data, ...)

## S3 method for class 'json'
as_mapbox_source(data, ...)

## S3 method for class 'data.frame'
as_mapbox_source(data, lng = "lng", lat = "lat",
  ...)

## S3 method for class 'sf'
as_mapbox_source(data, ...)

Arguments

data

A data frame that contains longitudes and latitudes in separate columns or an sf-object.

...

The properties of the source. See https://docs.mapbox.com/mapbox-gl-js/style-spec/sources for available options for the given source type.

lng

The name of the column containing the longitudes.

lat

The name of the column containing the latitudes.


mapboxer documentation built on Nov. 8, 2020, 4:21 p.m.