🚀 DAY 4 OF LAUNCH WEEK: Introducing GitHub Actions Scanning Support.Learn more →
Socket
Book a DemoInstallSign in
Socket

@openmeteo/mapbox-layer

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openmeteo/mapbox-layer

Protocol to read OMfiles and parse them to tiles for Mapbox / Maplibre

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
3
Created
Source

Open-Meteo Mapbox Layer

Test GitHub license npm version

⚠️ Notice This package is still under construction and is not yet fully production‑ready. API changes may occur and some features might be incomplete.

Overview

This repository demonstrates how to use the Open‑Meteo File Protocol (.om) with Mapbox / MapLibre GL JS. The .om files are hosted on an S3 bucket and can be accessed directly via the om protocol:

The actual weather API implementation lives in the open‑meteo/open‑meteo repository.

An interactive demo is available at maps.open‑meteo.com.

Installation

Node

npm install @openmeteo/mapbox-layer
...
import { omProtocol } from '@openmeteo/mapbox-layer';

// standard mapbox / maplibre setup
...

maplibregl.addProtocol('om', omProtocol);

const omUrl = `https://map-tiles.open-meteo.com/data_spatial/dwd_icon/2025/10/15/1200Z/2025-10-15T1400.om?variable=temperature_2m`;

map.on('load', () => {
	map.addSource('omFileSource', {
		url: 'om://' + omUrl,
		type: 'raster',
		tileSize: 256,
		maxzoom: 12 // tiles look pretty much the same below zoom-level 12, even on the high res models
	});

	map.addLayer({
		id: 'omFileLayer',
		type: 'raster',
		source: 'omFileSource'
	});
});

HTML / UNPKG

For a standalone example, see examples/temperature.html.

...
<script src="https://unpkg.com/@openmeteo/mapbox-layer@0.0.3/dist/index.js"></script>
...

<script>
	// Standard Mapbox / MapLibre GL JS setup
	// ...

	maplibregl.addProtocol('om', omProtocol);

	const omUrl = `https://map-tiles.open-meteo.com/data_spatial/dwd_icon/2025/10/15/1200Z/2025-10-15T1400.om?variable=temperature_2m`;

	map.on('load', () => {
		map.addSource('omFileSource', {
			url: 'om://' + omUrl,
			type: 'raster',
			tileSize: 256,
			maxzoom: 12 // tiles look pretty much the same below zoom-level 12, even on the high res models
		});

		map.addLayer({
			id: 'omFileLayer',
			type: 'raster',
			source: 'omFileSource'
		});
	});
</script>

Examples

The repository contains an examples directory with ready‑to‑run demos:

  • examples/temperature.html – shows temperature data from an OM file.
  • examples/precipitation.html – displays precipitation using a similar setup.
  • examples/custom-colorscale.html – shows how to use your own color definition.

Run the examples by opening the corresponding .html file in a browser.

Contouring

For contouring a new source must be added, since the contouring functionality uses vector tiles.

...

map.on('load', () => {
	map.addSource('omFileVectorSource', {
		url: 'om://' + omUrl,
		type: 'vector'
	});

	map.addLayer({
		id: 'omFileVectorLayer',
		type: 'line',
		source: 'omFileVectorSource',
		'source-layer': 'contours',
		paint: {
			'line-color': 'black',
			'line-width': 4
		}
	});
});

Keywords

open-meteo

FAQs

Package last updated on 23 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts