Point layer disabled zoom compensation (point helper)

This example demonstrates the process of incorporating a layer of points onto the map by utilizing the point layer helper while keeping zoom compensation disabled. Obtain the USA school’s sample data.

In this particular example, the size of the points is adjusted based on the quantity of students enrolled in each school. It is advisable to view this map at zoom level 12 since zoom compensation has been deactivated.

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: 12,
    center: [-73.99807, 40.71265],
    style: MapStyle.DATAVIZ.DARK
});

map.on('load', async function () {
  await helpers.addPoint(map, {
    data: 'schools.geojson',
    property: "students",
    pointColor: ColorRampCollection.PORTLAND.scale(200, 2000).resample("ease-out-sqrt"),
    pointOpacity: 0.8,
    minPointRadius: 6,
    maxPointRadius: 30,
    showLabel: true,
    zoomCompensation: false,
  });
});
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 (point helper)

Point layer (point helper)

Examples

Add minimal point layer using MapTiler point helper.

Color ramp resampling (color ramp)

Color ramp resampling (color ramp)

Examples

Visualize point layers by resampling existing map color ramps.

Was this helpful?