Heatmap layer custom color ramp (heatmap helper)

This example illustrates the process of incorporating a heatmap layer into the map by utilizing the heatmap layer helper. With the assistance of the helper, it becomes feasible to introduce a personalized color ramp. In the given example, we define a customized WARM color scheme, instead of the default TURBO option. To replicate this example, download the earthquake sample data.

NPM module setup


npm install --save @maptiler/sdk
import { Map, MapStyle, config, ColorRampCollection, 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: 6.56,
    center: [-119.715, 37.999],
    style: MapStyle.DATAVIZ.DARK
});

map.on('load', async function () {
  await helpers.addHeatmap(map, {
    data: 'YOUR_MAPTILER_DATASET_ID_HERE',
    colorRamp: ColorRampCollection.WARM,
  });
});
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.

Custom color ramp (color ramp)

Custom color ramp (color ramp)

Examples

Visualize point layers by creating custom map color ramps.

Point layer cluster (point helper)

Point layer cluster (point helper)

Examples

Add clustered point layer using MapTiler point helper.

Was this helpful?