JavaScript API examples

Each dotAtlas JavaScript API example demonstrates one specific functionality of dotAtlas.

All the example code is licensed under Apache Software License 2.0, feel free to adjust and copy to your code base as needed.


Quick start

Displaying your first dotAtlas map with just a few lines of JavaScript:

  • embedding dotAtlas in your page,
  • specifying simple multi-layer map data,
  • resizing visualization when window dimensions change.

Marker properties

Customizing the properties of markers on your map, including color, shape, size and opacity.

Label properties

Controlling label opacity and the color of label boxes, setting label display priorities so that the most important labels show at lower zoom levels.

Layer properties

Controlling properties of different dotAtlas layers, including:

  • layer visibility and opacity,
  • global and layer-specific marker properties,
  • label color, size scaling, collision and shadow,
  • saturation, shape and lighting properties of the elevation map.

Hover and selection

Detecting and drawing hover and selection highlights:

  • responding to hover and click events,
  • drawing hover and selection highlights using the layers the Selection plugin adds.

Custom zooming

Zooming to reveal the location of specific markers or labels on the map.

Updating properties

Changing colors, sizes, shapes and elevations of existing markers without reloading the whole data set.

Settings panel

Tweaking the options of dotAtlas and of its layers on a live map, with sample data sets and presets, and exporting the result as JavaScript code.

Lots of labels

The glyph atlas on a large synthetic label set, with SDF rendering opted in for crisp scaling and per-label outlines, atlas-quality tiers and edge controls.

Map legend

Adding a color band legend to the map, reading elevation values at specific coordinates of the map.

Lingo4G embedding

Converting Lingo4G analysis result containing document embedding and document clusters to a dotAtlas map, where each marker represents one document.

Visualizing 1M+ points

Using dotAtlas to efficiently visualize more than 1 million data points.