Interactive Maps Using 'Mapbox GL JS' and 'Deck.gl'

Provides a mechanism to plot an interactive map using 'Mapbox GL' (< https://www.mapbox.com/mapbox-gl-js/api/>), a javascript library for interactive maps, and 'Deck.gl' (< http://deck.gl/#/>), a javascript library which uses 'WebGL' for visualising large data sets.


CRAN_Status_Badge downloads CRAN RStudio mirrordownloads GithubStars BuildStatus CoverageStatus

What is mapdeck?

An R library which lets you plot interactive maps using Mapbox GL and Deck.gl

What is mapbox?

We provide building blocks to add location features like maps, search, and navigation into any experience you create.

What is deck.gl?

deck.gl is a WebGL-powered framework for visual exploratory data analysis of large datasets.

How do I use it?

Everything you need to know to get you started is on the home page

Installation

From cran

install.packages("mapdeck")

Development version

Version v0.1.006+ sees quite a lot of changes, so I need users to test their functions and report any errors.

To use the development version you need some other development dependant libraries

devtools::install_github("SymbolixAU/mapdeck")

Getting Started

Mapdeck uses Mapbox maps, and to use Mapbox you need an access token.

Once you’ve generate a token you can use their maps.

Call mapdeck(token = 'your_token') to generate a basic map. Then start adding layers by using one of the various add_*() functions.

url <- 'https://raw.githubusercontent.com/plotly/datasets/master/2011_february_aa_flight_paths.csv'
flights <- read.csv(url)
flights$info <- paste0("<b>",flights$airport1, " - ", flights$airport2, "</b>")
 
mapdeck(token = key, style = mapdeck_style('dark')) %>%
  add_arc(
    data = flights
    , origin = c("start_lon", "start_lat")
    , destination = c("end_lon", "end_lat")
    , stroke_from = "airport1"
    , stroke_to = "airport2"
    , tooltip = "info"
    , layer_id = 'arclayer'
  )

Arcs

News

mapdeck 0.2

  • different palettes for both stroke & fill options
  • stroke_colour fix for polygons
  • transitions argument for most layers
  • mapdeck() argument order changed so data is first ( to work better with pipes )
  • update_view and focus_layer added to focus layers on data
  • bearing and pitch maintained on data layer updates
  • bearing argument to mapdeck()
  • add_geojson() fully supported
  • add_sf() convenience function
  • Z attributes supported
  • MULTI-geometry sf objects supported
  • can use variables in place of string arguments
  • highlight_colour argument
  • all add_*() functions migrated to c++
  • layer_id is optional to the user
  • auto_highlight argument

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.