Leaflet · Raster-PMTiles
import { PMTiles, leafletRasterLayer } from 'pmtiles';
const manifestUrl = 'https://raster-pilot.openfiremap.org/manifest.json';
const manifest = await fetch(manifestUrl).then(r => r.json());
const archiveUrl = new URL(manifest.file, manifestUrl).href;
const archive = new PMTiles(archiveUrl);
leafletRasterLayer(archive, {
attribution: '© OpenStreetMap contributors'
}).addTo(map);
Die Rasterkacheln enthalten alle sichtbaren OFM-Inhalte gemeinsam; Einzelschalter gibt es in der Rasterdatei nicht.
MapLibre GL JS · Raster-PMTiles
import maplibregl from 'maplibre-gl';
import { Protocol } from 'pmtiles';
const protocol = new Protocol();
maplibregl.addProtocol('pmtiles', protocol.tile);
const manifestUrl = 'https://raster-pilot.openfiremap.org/manifest.json';
const manifest = await fetch(manifestUrl).then(r => r.json());
const archiveUrl = new URL(manifest.file, manifestUrl).href;
map.addSource('ofm-overlay', {
type: 'raster',
url: `pmtiles://${archiveUrl}`,
tileSize: 256,
attribution: '© OpenStreetMap contributors'
});
map.addLayer({ id: 'ofm-overlay', type: 'raster',
source: 'ofm-overlay' });
MapLibre kann Raster-PMTiles als eigene Rasterquelle laden. Für getrennte OFM-Layer wird ein passender Vektor-Datensatz benötigt.