Atlaslog
Atlaslog / deck.gl / Tutorial / Views and coordinate systems
deck.gl · Tutorial

Views and coordinate systems

Quick answer

This tutorial separates View, which describes a viewport, from viewState, which describes the camera. It compares MapView, OrbitView, FirstPersonView and OrthographicView, lists longitude, latitude, zoom, pitch and bearing, and shows a controlled viewState with onViewStateChange plus multi-view layouts using viewId. It then covers LNGLAT, METER_OFFSETS and CARTESIAN systems and WebMercatorViewport project, unproject and fitBounds.

Last verified 2026-11-03 · deck.gl 9.0 · Cite this page
Key points
Example
var view = { longitude: 116.39, latitude: 39.9, zoom: 9, pitch: 0, bearing: 0 };

var deckgl = new deck.Deck({
  canvas: 'cv',
  width: '100%',
  height: '100%',
  viewState: view,
  controller: true,
  onViewStateChange: function (e) {
    view = e.viewState;
    deckgl.setProps({ viewState: view });
  },
  layers: []
});
views: [
  new deck.MapView({ id: 'main' }),
  new deck.MapView({
    id: 'overview',
    x: 12, y: 12,
    width: 260, height: 180,
    controller: true
  })
]
Notes
Runnable examplesChinese originalAll Tutorials
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). Views and coordinate systems. https://www.jingweizhi.com/en/deckgl/tutorials/views-coordinates.html (accessed 2026-11-03).