For the technically curious
Technology
A look under the hood. This page describes the building blocks of OpenFireMap, the services involved and what happens when a map area loads. You need none of this to use the map.
At a glance
OpenFireMap is a pure web app. There is no application server of its own, no database of user data and no accounts. Your browser loads the app from GitHub Pages and fetches everything else directly from the services involved: the own base map and the fire service objects as prepared tiles from Cloudflare, other background maps from the map providers, changes and the rest of the world live from Overpass, search results from Nominatim.
| Building block | Technology | Job |
|---|---|---|
| Web app | JavaScript (ES modules, no framework), Vite, Leaflet, Tailwind CSS | map, symbols, controls, export |
| OpenFireMap base map | MapLibre GL JS inside Leaflet, vector tiles as PMTiles, own style | background map for DACHLiLu, day and night |
| Hosting | GitHub Pages | serves HTML, JavaScript and CSS |
| Fire service data | OpenStreetMap, prepared as PMTiles | hydrants, water points, stations, defibrillators, municipal boundaries |
| Data delivery | Cloudflare R2 with edge cache | prepared tiles for 48 countries and territories, base map |
| Live data | Overpass API | changes since the data date, rest of the world |
| Search | Nominatim | find places and addresses |
| Town plan | MapLibre GL JS, the same base map with a print style | print-ready plan in the browser |
The web app's source code is public on GitHub: FrnkMrz/OpenFireMapV2, under the MIT licence. A detailed architecture description for developers (in German) is in docs/ARCHITEKTUR.md.
The web app in the browser
The app consists of JavaScript modules without a framework. Vite bundles them at build time, Leaflet draws map, symbols and circles. The start sequence:
- Language: the interface loads its texts (30 languages, German and English as fallback).
- Interface: buttons, menus and dialogs are wired up. On phones a separate control layer sits on top and triggers the desktop buttons instead of duplicating logic.
- Map: Leaflet starts at the area in the address bar (
#zoom/lat/lon/layer) or at the last place viewed. If the link names no layer, the app picks one by the starting place: the OpenFireMap map in DACHLiLu, Voyager elsewhere. - Loading later: the export part (PDF, PNG, GPX, CSV) loads after start-up, and MapLibre for the base map only once an OpenFireMap layer is selected. This makes the map appear sooner.
All fixed values such as addresses, time limits and colours live in one place, src/js/config.js. The map area is always in the address bar, so any view can be shared as a link.
Base maps
OpenFireMap has its own base map and also uses external map services. The external maps are raster tiles (256 × 256 pixels) that the browser fetches directly from each provider. OpenFireMap does not store them.
| Layer | Source |
|---|---|
| OpenFireMap, OpenFireMap · Night | own vector map from OpenStreetMap, tile schema by Protomaps, see below |
| Voyager, Print (Light), Night (Dark) | CARTO basemaps based on OpenStreetMap |
| OSM (Intl), OSM (DE Style) | OpenStreetMap and OpenStreetMap Germany |
| Topographic | OpenTopoMap (OSM and SRTM elevation data) |
| Satellite | Esri World Imagery |
| Bavaria Base, Bavaria Aerial | Bavarian Surveying Administration (open data) |
Attributions are shown at the bottom right of the map and in every export.
The own base map
The OpenFireMap and OpenFireMap · Night layers are not images but vector tiles: roads, buildings, water and labels arrive as geometry and attributes and are only drawn in the browser. What the colours and signs mean is explained on the page The OpenFireMap map.
- Build: the pipeline builds vector tiles in the Protomaps schema from OpenStreetMap extracts with Planetiler. The area is a rectangle around Germany, Austria, Switzerland, Liechtenstein and Luxembourg with some margin. The map is rebuilt at intervals, not daily like the fire service objects.
- Delivery: the result is a single PMTiles file on Cloudflare. A small pointer file names the current version, so all browsers switch to a new build at the same time. As with the fire service objects, the browser reads only the tiles of the current view with HTTP range requests.
- Drawing: MapLibre GL JS draws the tiles with WebGL as one layer inside the Leaflet map. Leaflet still draws the symbols and circles on top. MapLibre only loads once you select an OpenFireMap layer.
- Style: the fire service style is written in the project itself: no red, strong roads, early house numbers and square signs for hospitals, schools and similar places. The browser creates the signs itself, the font (Noto Sans) is served from openfiremap.org. The night version uses the same tiles with different colours.
If the view extends beyond the rectangle, the app puts a CARTO map underneath (Voyager, at night Night (Dark)) that only shows where the own map has no tiles. Inside the rectangle it does not request CARTO at all. If the base map cannot be reached or WebGL is missing, only the CARTO map remains.
The fire service objects
All fire service objects come from OpenStreetMap. OpenFireMap reads these tags:
| Layer | OSM tags | from zoom |
|---|---|---|
| Fire stations | amenity=fire_station, building=fire_station |
12 |
| Hydrants and fire water | emergency=fire_hydrant, water_tank, suction_point, fire_water_pond, cistern |
15 |
| Defibrillators | emergency=defibrillator |
15 |
| Municipal boundaries | boundary=administrative with admin_level=8 |
14 |
The full machine-readable list of tags used is in taginfo.json and on Taginfo.
A map area step by step
On every map move OpenFireMap waits briefly until the map is at rest, cancels any running request with an AbortController and then loads again.
- Check the area: is the view in Germany, Austria, Switzerland, Liechtenstein or Luxembourg (DACHLiLu), or in one of the 40 European countries or in Japan, Taiwan or Malaysia-Singapore-Brunei, whose file is listed in the manifest? Rough rectangles pre-filter, simplified country outlines decide.
- Read tiles: a PMTiles file is one big archive of vector tiles. The browser first reads the directory and then uses HTTP range requests to fetch only the bytes of the 2 to 6 tiles the view needs. Tiles are built up to zoom 14 and scaled up beyond that.
- Draw at once: the visible area appears as soon as its tiles arrive. A margin around it loads in the background, so small moves need no new request.
- Live delta: the tiles have a data date (
osm_data_until). For everything changed in OpenStreetMap since then, the app asks Overpass withnewer:and replaces or adds objects by OSM type and ID. - Fallback: outside the pipeline area, on errors, or if the files do not fully cover the view, the app queries Overpass directly.
This is what the live query for hydrants looks like (shortened):
[out:json][timeout:10][bbox:49.54,11.33,49.57,11.38];
(
nwr["emergency"~"fire_hydrant|water_tank|suction_point|fire_water_pond|cistern"]
(newer:"2026-11-20T21:21:21Z");
node["emergency"="defibrillator"](newer:"2026-11-20T21:21:21Z");
)->.pois;
.pois out center;
Overpass servers
OpenFireMap knows four public Overpass servers and tries them in random order, each at most once. If one answers with 429 (too many requests), a 5xx error or not at all, the app pauses it for a few minutes and moves on. A response with an outdated data date (timestamp_osm_base) is discarded for the live delta, so the map never wrongly claims to be up to date.
The data pipeline
The prepared tiles come from an automatic pipeline of the project. Its code lives in a separate, non-public repository. The flow:
- Update: the country extracts from Geofabrik in
.osm.pbfformat. The pipeline does not download them again each time (many gigabytes in total); for every area, DACHLiLu as well as the other countries, it applies only Geofabrik's daily change files with pyosmium. If a file is missing or damaged, or no change files arrive any more, it downloads the full extract once. This gives a new data state every day while Geofabrik only serves a few megabytes. - Filter: Osmium extracts only the fire service objects and municipal boundaries.
- Prepare: a Python program turns them into GeoJSON per layer, with OSM type and ID on every object (for the live delta) and the data date from the PBF header.
- Build tiles: Tippecanoe creates vector tiles up to zoom 14 and writes them as one PMTiles file.
- Only finished results: if a step fails, nothing is published and the previous data stays online.
- Publish: upload to Cloudflare R2, then the description files, and finally a targeted purge of the Cloudflare cache.
| Area | File |
|---|---|
| DACHLiLu | one shared file |
| 40 European countries, Japan, Taiwan, Malaysia-Singapore-Brunei | one file per country, with a time stamp in the name |
| OpenFireMap base map and town plan (rectangle around DACHLiLu) | separate file, built with Planetiler, rebuilt at intervals |
How current the data is in each area is explained under Data & freshness.
Public description files
Anyone can read two files; they steer the app:
metadata.json: data date (osm_data_until), build time (generated_at), object counts and extract ages for DACHLiLu. The app appends the build time to the tile address (?v=…), so after a new build nobody gets old tiles from a cache.eu/regions.json: the manifest of the countries outside DACHLiLu (Europe and Asia; the name dates from the start) with file name, rectangle, data date and object counts per country. The app reads it strictly: a file name must match its country exactly, otherwise the entry is ignored.
Several countries in one view
A view at a border needs several files. The app opens them in parallel, merges objects by OSM type and ID and draws boundary lines contained in both extracts only once. As data date it shows the oldest of the files involved. If that is too old for a live delta (more than 10 days), it skips the delta instead of sending a huge query.
Place search
Search uses the public Nominatim service of the OpenStreetMap Foundation. OpenFireMap follows its usage policy: a request is only sent when you submit the search with Enter or the button, not while you type.
Cache and offline
- Loaded data is kept in the browser in IndexedDB. You choose how long (off, 1 hour, 1 day, 3 days, 7 days or 30 days; 7 days by default).
- Settings such as language and last view are kept in
localStorage. - A service worker stores only the app shell so the app starts quickly and can be installed. It deliberately does not store data or map images: an offline map would show outdated water sources as valid.
Export and town plan
Export also runs entirely in the browser. The app assembles the plan on a canvas:
- Base map: raster maps are put together from the provider's tiles. For the CARTO and OSM maps the contrast is raised (print curve), because these light maps otherwise look pale on paper. For the OpenFireMap layers, an invisible MapLibre map draws the light style in blocks of at most 2048 pixels per side, because Safari refuses larger WebGL areas. If that fails, the export uses Voyager and reports the reason.
- Black and white: with B/W, a tone curve converts only the base map into strong greys before borders and symbols are drawn on top. That is why the symbols stay in colour.
- Layout: Plan puts a frame, header and footer around the map, Map only writes just the scale bar and credit into the image.
- Files: jsPDF creates the PDF file, GPX and CSV are written by the app itself.
The area is limited to 10 km per side. On top of that comes the image size the browser can handle: 4096 × 4096 pixels is safe (Safari on iPhone and iPad), on a computer up to 8192 × 8192 pixels if the browser can actually create an image that large. If the area does not fit at the chosen zoom level, the export uses the largest level that fits. Below zoom 15 it loads the hydrants itself, because the map has not loaded them there yet. What this means in practice is described under Export.
The town plan uses MapLibre GL JS with the same base map as the main map, but with its own print style for 300 dpi.
Data status and status page
The "Data status & source" window in the map shows where the data in the view comes from (tiles, Overpass or cache) and how old the base data is. The status page reads metadata.json and eu/regions.json live and shows data date, object counts and density per inhabitant for each country (population figures from Eurostat, the World Bank and NISRA).
Accessibility
Accessibility is built into the technology, not only the design. What it means for you is on the Accessibility page. Technically:
- Dialogs: one shared helper controls all windows. It moves focus inside, keeps the Tab key in the dialog, locks the rest with
inert, closes on Escape and returns focus to the trigger. - Markers: from zoom 17 symbols are tab stops with a meaningful
aria-label. Enter opens the details and announces them through a live region. - Messages: two fixed live regions,
role="alert"only for errors androle="status"for everything else, so screen readers neither repeat nor miss anything. - Contrast: text on the semi-transparent panels must reach 4.5:1 and symbols 3:1, on light and dark map backgrounds. Because checking tools cannot rate panels over map tiles, a dedicated test measures this.
- Automated checks: axe-core checks map, dialogs, all languages and the help pages on every change.
Security
Without servers and accounts there is little to attack. What remains is protected:
In the browser
- Content Security Policy: scripts only come from openfiremap.org itself, with no inline scripts. Connections and images are only allowed to the services listed above. A test makes sure every service in the configuration is in the policy, and only those. The help pages also allow no inline styles.
- Permissions Policy: camera, microphone, payments, USB and motion sensors are switched off. Only the page itself may ask for your location, and only when you press the button.
- External data escaped: everything from OpenStreetMap is third-party input. Names and tags are escaped before display so no injected HTML can run. The GPX export escapes XML special characters.
- Strict checks of pipeline files: manifest, file names and coverage are verified before the app trusts them.
- HTTPS only: the site and all services are encrypted. External links open with
rel="noopener".
In the code and delivery
- Few dependencies: at runtime the app needs only a few libraries, with versions pinned in
package-lock.json. - Automatic checks on every change: GitHub Actions runs
npm audit(high risks in runtime dependencies stop the build), plus linter, unit and browser tests. Only a green run is deployed. - Updates: Dependabot proposes updates weekly, security updates immediately.
- Secrets: GitHub secret scanning with push protection keeps keys out of the repository. Each job in the workflow only has the permissions it needs.
- Pipeline: write access to storage exists only on the build machine, and each credential is limited to its task. The storage is read-only from outside; browser requests (CORS) are only allowed for openfiremap.org and local development.
Privacy, technically
OpenFireMap sets no cookies and uses no tracking or analytics. Because the app runs in your browser, every service it contacts sees your IP address and the requested area:
| Service | When | What is sent |
|---|---|---|
| GitHub Pages | on opening | request for the app |
| Map providers | while displaying | tile coordinates of the chosen layer |
| Cloudflare | in the pipeline area, with the OpenFireMap map, in the town plan | byte ranges of the PMTiles files |
| Overpass | live delta, rest of world, export | rectangle of the view |
| Nominatim | when searching, for the suggested export and town plan title | your search term or the centre of the map area |
The legal details are in the privacy policy.
Quality and delivery
- Unit tests with Vitest for data preparation, pipeline logic, geometry, export and the help pages.
- Browser tests with Playwright in Chromium: map, loading with real data, export, town plan, accessibility and contrast.
- Translations: a script checks that all 30 languages have every text.
- Delivery: every change comes in through a reviewed pull request. After merging into
main, GitHub Actions rebuilds the site and publishes it on GitHub Pages without manual steps.
Links and sources
- Source code: github.com/FrnkMrz/OpenFireMapV2, bugs and wishes as an issue
- Version history: CHANGELOG
- Data: OpenStreetMap (ODbL), extracts from Geofabrik
- Formats and tools: PMTiles, Tippecanoe, Osmium, pyosmium, Planetiler
- Services: Overpass API, Nominatim, Cloudflare R2, GitHub Pages
- Libraries: Leaflet, MapLibre GL JS, jsPDF, Vite, Tailwind CSS
- Data status: status page
Your question is not here? Write to us: info@openfiremap.org
All topics