Table of Contents

Layers: An Introduction to Map Creation with Deck.gl

Deck.gl is part of the vis.gl framework suite, an open source framework for big data visualizations. The basic idea of using Deck.gl is to render a stack of visual overlays, usually over maps.

 
This image has an empty alt attribute; its file name is bitmap-layer.png
 
Figure 1. Column Layer example
 

Layers in a Map

A layer is a packaged visualization type which takes a collection of data, every element with a position, color and it is rendered on a map. This data could be from a GeoJSon file or CSV, as an example, and could be represented in BitmapLayer, GeoJSon layer, line or polygon layer, among others. The layers are represented over a map, we have to indicate the position and the zoom, as parameters.

This image has an empty alt attribute; its file name is Screen-Shot-2019-12-02-at-4.45.49-PM.png
 
Figure 2. Initial values from map
 

Elements of a Layer

To construct a Layer, you can instantiate an object with some properties,

  • Layer ID: the unique identifier of this layer among all layers. It is recommended that this prop is set explicitly to avoid collision.
  • Data: specifies data source of this layer's visualization. The value is expected to be a collection in JavaScript; Array, Map or Set, any object that contains a length field.
  • Accessor: maps an object in data to its visual configuration, e.g. the radius of a circle, the color of a line, etc. All accessor prop names start with get.
  • Other Layer Props: The rest of the props are typically numeric or boolean values. This includes props that define the render options (opacity, font family of the TextLayer, etc.), coordinate system, and interactivity.

 

This image has an empty alt attribute; its file name is Screen-Shot-2019-12-02-at-3.01.48-PM.png
 
Figure 3. Code to create a layer
 
This image has an empty alt attribute; its file name is column-layer.png
 
Figure 4. Layer over map
 

Deck.gl allows you to render multiple layers using the same or different data sets. You simply provide an array of layer instances and the framework will render them in order. The layer can specify how its state is initialized and finalized, if and how it should react to property changes, and how it should draw and pick the layer.

Internally, Deck.gl sets up the animation loop and calls provided callbacks on initial load and for each rendered frame. When the layer list is drawn to screen it matches the new layer instances with the instances from the previous render call, and they are uniquely identified by their id property. Every time you create a new layer with the same id property as a layer you rendered last time, Deck.gl considers the new layer instance an "update" of the old instance.

Finally..

Deck.gl is part of the frameworks created by Uber, a good option to create beautiful maps with different layers and effects. It can be useful if we want to represent data in a map, and JavaScript development makes very easy to use.

This image has an empty alt attribute; its file name is Animated-GIF-downsized.gif
 

Vision meets Robotics: The KITTI Dataset” licensed under CC BY-NC-SA 3.0.  "Lexus IS F 3D Model" by Yo.Ri licensed under CC BY 4.0
 
 

Learn More about Encora

We are the software development company fiercely committed and uniquely equipped to enable companies to do what they can’t do now.

Learn More

Global Delivery

READ MORE

Careers

READ MORE

Industries

READ MORE

Related Insights

Online Travel Agencies: Some Solutions to changes in booking and commission attributions

Discover how we can simplify travel changes for both travelers and OTAs using blockchain and ...

Read More

The AI-Powered Journey: How AI is Changing the Face of Travel

As travel elevates itself into an experience where every journey is as unique as the travelers ...

Read More

Enhancing Operational Excellence with AI: A Game-Changer for the Hospitality Industry

By AI, the hospitality industry can offer the best of both worlds: the efficiency and ...

Read More
Previous Previous
Next

Accelerate Your Path
to Market Leadership 

Encora logo

Santa Clara, CA

+1 669-236-2674

letstalk@encora.com

Innovation Acceleration

Speak With an Expert

Encora logo

Santa Clara, CA

+1 (480) 991 3635

letstalk@encora.com

Innovation Acceleration