Weather Plus pressure isolines layer labels

Experience the visualization of weather pressure isolines on the MapTiler Weather Plus. Utilize the Pressure dataset to access this layer and observe the extreme values of high and low pressure.

By employing the showPressureLabels function within the pressure layer, these extreme Hi/Lo pressure values are prominently displayed for easy reference.

NPM module setup


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

config.apiKey = 'YOUR_MAPTILER_API_KEY_HERE';
const map = (window.map = new Map({
  container: 'map', // container's id or the HTML element to render the map
  style: MapStyle.BACKDROP,  // stylesheet location
  projectionControl: true,
  projection: 'globe',
  zoom: 1.5,
  center: [-15.5, 15.2],
}));

const labelsButton = document.getElementById("show-labels");
let hasLabels = false;

const weatherLayer = new PressureIsolineLayer({
  opacity: 0.8,
});

map.on('load', function () {
  map.setPaintProperty("Water", 'fill-color', "rgba(0, 0, 0, 0.4)");
  map.addLayer(weatherLayer, 'Water');  
});

labelsButton.addEventListener("click", () => {
  hasLabels = !hasLabels;
  labelsButton.innerText = hasLabels ? "Hide labels" : "Show labels";
  if (hasLabels) {
    weatherLayer.showPressureLabels();
  } else {
    weatherLayer.hidePressureLabels();
  }
});

Learn more

Look at the Weather Plus pressure isolines layer example

Look at the Weather Plus pressure isolines layer animated example

Check out the Weather JS module reference

Check out the Pressure Isolines layer reference

Weather custom popup

Weather custom popup

Examples

Create highly customizable popups for weather maps using MarkerLayout.

Weather layer switcher

Weather layer switcher

Examples

Switch weather layers and view detailed data under cursors.

Weather Plus wind arrow layer

Weather+ wind arrow layer

Examples

Visualize wind direction and speed using animated wind arrows.

Weather Plus pressure isolines layer animated

Weather+ pressure isolines layer animated

Examples

Animate atmospheric pressure isolines and view precise cursor data.

Was this helpful?