Heatmap layer intensity (heatmap helper)

This example shows how to add a heatmap layer with a custom intensity to the map using the heatmap layer helper. Download the earthquake sample data to replicate this example.

In this example, we use a custom intensity zoom ramping higher than the default to add some boost to the heatmap’s impact.

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: 8.33,
    center: [-116.715, 33.542],
    style: MapStyle.DATAVIZ.LIGHT
});

map.on('load', async function () {
  await helpers.addHeatmap(map, {
    data: 'YOUR_MAPTILER_DATASET_ID_HERE',
    intensity: [
      {zoom: 5, value: 1},
      {zoom: 12, value: 5},
    ]
  });
});
Heatmap layer (heatmap helper)

Heatmap layer (heatmap helper)

Examples

Quickly add a heatmap layer using the heatmap helper.

Create a heatmap layer

Create a heatmap layer

Examples

Visualize point data frequency using a custom heatmap layer.

Heatmap layer radius and weight by property (heatmap helper)

Heatmap layer radius and weight by property (heatmap helper)

Examples

Control heatmap radius and weight using data properties.

Point layer cluster (point helper)

Point layer cluster (point helper)

Examples

Add clustered point layer using MapTiler point helper.

Was this helpful?