Point layer (point helper)

This example shows how to add a point layer to the map using the point layer helper with the default values. Download the earthquake sample data.

In this example, the color is chosen randomly from a predetermined list of colors. This is the standard default behavior when no specific color is mentioned.

NPM module setup


npm install --save @maptiler/sdk
import { Map, MapStyle, config, helpers } from '@maptiler/sdk';
import '@maptiler/sdk/dist/maptiler-sdk.css';

config.apiKey = 'YOUR_MAPTILER_API_KEY_HERE';
const map = new Map({
    container: 'map',
    zoom: 4.30,
    center: [-119.602, 35.732],
    style: MapStyle.DATAVIZ.LIGHT
});

map.on('load', async function () {
  await helpers.addPoint(map, {
    data: 'YOUR_MAPTILER_DATASET_ID_HERE',
  });
});
Point layer cluster (point helper)

Point layer cluster (point helper)

Examples

Add clustered point layer using MapTiler point helper.

Heatmap layer (heatmap helper)

Heatmap layer (heatmap helper)

Examples

Quickly add a heatmap layer using the heatmap helper.

Point layer labels (point helper)

Point layer labels (point helper)

Examples

Add labeled point layer using MapTiler point helper.

Point layer scaled radius by property (point helper)

Point layer scaled radius by property (point helper)

Examples

Scale point layer radius and color by property.

Was this helpful?