Docs › Products
Map & style.json
Show the Wazli map in a web page or app: the style.json address, its light and dark looks, English and Arabic labels, and how map loads are counted.
What to send
The map is a MapLibre style at https://map.wazli.com/api/maps/v1/style.json. The website kit asks for it for you; a phone app or MapLibre page asks for it with a key that has the Map product.
| Parameter | What it is |
|---|---|
key | Your website or phone app key (with Map). |
lang | "en" (default) or "ar": the language of the map's labels. |
look | "light" (default) or "dark". |
style | The name of one of your account's Map styles; its base look replaces look. |
What comes back
A MapLibre style (JSON, version 8). Its map data comes from tiles.wazli.com as pmtiles:// addresses, so plain MapLibre needs the PMTiles protocol (the example shows how; the website kit has it built in). The answer is never cached: each load counts one map load, and moving or zooming after that does not count.
{
"version": 8,
"glyphs": "https://tiles.wazli.com/assets/fonts/{fontstack}/{range}.pbf",
"sprite": "https://tiles.wazli.com/assets/sprites/wazli/v2/light",
"sources": {
"protomaps": { "type": "vector", "url": "pmtiles://https://tiles.wazli.com/world/20261031.pmtiles", ... }
},
"layers": [ { "id": "background", "type": "background", ... }, ... ]
}Example
In a web page, the website kit is the short way; its own page is map.wazli.com/developers/website-kit.
<link rel="stylesheet" href="https://map.wazli.com/maps/v1/wazli-maps.css">
<script src="https://map.wazli.com/maps/v1/wazli-maps.js"></script>
<div id="map" style="height: 400px"></div>
<script>
WazliMaps.createMap("map", {
key: "YOUR_WEBSITE_KEY",
center: [44.366, 33.315], // Baghdad: longitude, latitude
zoom: 12,
look: "dark",
lang: "ar",
});
</script>With MapLibre itself, register the PMTiles protocol, then load the style:
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@6.11.1/dist/maplibre-gl.css">
<script src="https://unpkg.com/pmtiles@4.5.0/dist/pmtiles.js"></script>
<div id="map" style="height: 400px"></div>
<script type="module">
import * as maplibregl from "https://unpkg.com/maplibre-gl@6.11.1/dist/maplibre-gl.mjs";
maplibregl.addProtocol("pmtiles", new pmtiles.Protocol().tile);
new maplibregl.Map({
container: "map",
style: "https://map.wazli.com/api/maps/v1/style.json?key=YOUR_WEBSITE_KEY&lang=en&look=light",
center: [-81.379, 28.538],
zoom: 12,
});
</script>