Hosted Map Tiles
Serve raster XYZ map tiles and static map images directly from Map Zena, with multiple styles and global coverage.
Hosted Map Tiles
Map Zena provides hosted raster map tiles using the standard XYZ tile scheme, compatible with any mapping library that accepts tile URLs. A static map image endpoint lets you generate map images server-side for embedding in emails, PDFs, or pages without a JavaScript mapping library.
Note: Hosted map calls work in anonymous mode up to the free 500 requests/day allowance.
Tile endpoint
GET
https://tiles.mapzena.com/v1/{style}/{z}/{x}/{y}.png
URL parameters
| Segment | Description |
|---|---|
{style} | Map style name. See styles table below. |
{z} | Zoom level. Range: 0-19. |
{x} | Tile column index (east-west). |
{y} | Tile row index (north-south, TMS y=0 is top). |
key | Optional query parameter for registered usage. Anonymous requests are allowed until free quota is exhausted. |
Map styles
| Style name | Description |
|---|---|
streets | General-purpose street map with roads, buildings, and labels. Clean, light background. |
streets-dark | Dark mode street map. Optimised for dashboards and night-mode UIs. |
satellite | Aerial/satellite imagery. Available at zoom 0-19 for most regions. |
satellite-labels | Satellite imagery with place name and road label overlay. |
terrain | Physical relief map with elevation shading, rivers, and topographic features. |
terrain-labels | Terrain with place name labels. |
minimal | Stripped-back base map showing only borders, coastlines, and major labels. Ideal as a data visualisation base. |
Example tile URLs
tile urls
https://tiles.mapzena.com/v1/streets/12/2047/1379.png
https://tiles.mapzena.com/v1/streets-dark/{z}/{x}/{y}.png?key=YOUR_KEY
https://tiles.mapzena.com/v1/terrain/{z}/{x}/{y}.png?key=YOUR_KEY
Using tiles with Leaflet (no JS CDN)
If you host your own Leaflet JS (not from a CDN), you can use Map Zena tiles as the tile layer URL:
javascript - leaflet (self-hosted)
const map = L.map('map').setView([48.8566, 2.3522], 12); L.tileLayer('https://tiles.mapzena.com/v1/streets/{z}/{x}/{y}.png?key=YOUR_KEY', { attribution: '© Map Zena | © <a href="https://www.openstreetmap.org/copyright">OSM</a>', maxZoom: 19 }).addTo(map);
Static map images
The static map endpoint generates a PNG map image from server-side parameters. No JavaScript required in the client at all.
GET
https://api.mapzena.com/v1/staticmap
Static map parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key |
string | optional | Optional in free mode. Required for metered usage above the free allowance. |
center |
string | required | Latitude,longitude of the map centre. E.g. 48.8566,2.3522. |
zoom |
integer | required | Zoom level 0-19. |
size |
string | required | Image dimensions in WIDTHxHEIGHT pixels. Max: 2048x2048. |
style |
string | optional | Map style. Default: streets. See styles table above. |
marker |
string | optional | Place a pin at lat,lon. Repeatable for multiple markers: &marker=48.8566,2.3522&marker=51.5074,-0.1278. |
retina |
0 or 1 | optional | Return a 2× resolution image for HiDPI displays. Default: 0. |
format |
string | optional | png (default) or jpeg. |
Example static map request
bash - curl
curl "https://api.mapzena.com/v1/staticmap?center=48.8566,2.3522&zoom=12&size=800x500&style=streets&marker=48.8566,2.3522&key=YOUR_KEY" \
-o paris.png
Embedding a static map in PHP
php
<?php $key = 'YOUR_KEY'; $center = '48.8566,2.3522'; $zoom = 12; $size = '800x400'; $src = "https://api.mapzena.com/v1/staticmap?center={$center}&zoom={$zoom}&size={$size}&key={$key}"; echo '<img src="' . htmlspecialchars($src) . '" alt="Map of Paris" width="800" height="400">';
Attribution requirement
Map tiles are rendered from OpenStreetMap data. Any end-user-facing map must include the following attribution:
html
<small>© <a href="https://mapzena.com">Map Zena</a> | © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap contributors</a></small>
Error codes
| HTTP | Code | Description |
|---|---|---|
| 400 | invalid_style | Unknown style name. |
| 400 | invalid_size | Size exceeds 2048px in either dimension. |
| 400 | invalid_zoom | Zoom out of range 0-19. |
| 402 | insufficient_credit | API key has insufficient account credit. |
| 429 | anonymous_quota_exceeded | Free anonymous quota reached. |
| 429 | rate_limit_exceeded | Tile burst limit reached. Each tile request counts as one unit. |