--- title: Vector Tiles | Plaza Docs description: Serve Plaza's OSM data as Mapbox Vector Tiles for use with MapLibre GL JS and other renderers. --- Plaza serves OSM data as Mapbox Vector Tiles (MVT), compatible with MapLibre GL JS, Mapbox GL JS, or any MVT renderer. ## Endpoint ``` GET /api/v1/tiles/{z}/{x}/{y} ``` Returns a `application/vnd.mapbox-vector-tile` protobuf. ## Tile coordinates | Zoom | Tiles | Coverage per tile | | ---- | ------ | ----------------- | | 8 | \~66K | \~Region | | 10 | \~1M | \~City | | 14 | \~268M | \~Neighborhood | | 18 | \~69B | \~Building | | 22 | \~17T | \~Sub-building | Plaza serves zoom 8–22. Requests below zoom 8 return an error. Higher zooms include finer detail (buildings, footpaths, addresses). ## Layers | Layer | Contents | | ------- | ------------------------------------------------------ | | `nodes` | Points of interest (amenities, shops, addresses, etc.) | | `ways` | Roads, buildings, parks, rivers, land use polygons | Each feature includes `osm_id` and `name` (if the `name` tag exists). ## MapLibre GL JS ```
``` ## Authentication for tiles Map renderers issue tile requests automatically and don’t support custom headers, so pass the API key as a query parameter: ``` https://plaza.fyi/api/v1/tiles/{z}/{x}/{y}?api_key=pk_live_abc123 ``` The `x-api-key` header still works for manual fetches. ## Combining with your own data ``` const map = new maplibregl.Map({ container: 'map', center: [-122.42, 37.78], zoom: 13, style: { version: 8, sources: { plaza: { type: 'vector', tiles: ['https://plaza.fyi/api/v1/tiles/{z}/{x}/{y}?api_key=YOUR_KEY'], minzoom: 8, maxzoom: 22, }, stores: { type: 'geojson', data: '/my-store-locations.geojson', }, }, layers: [ // Plaza base layers { id: 'ways', type: 'line', source: 'plaza', 'source-layer': 'ways', paint: { 'line-color': '#ccc', 'line-width': 1 }, }, // Your data on top { id: 'my-stores', type: 'circle', source: 'stores', paint: { 'circle-radius': 8, 'circle-color': '#ff4444', 'circle-stroke-color': '#fff', 'circle-stroke-width': 2, }, }, ], }, }); ``` ## Caching Tiles are cacheable for 1 hour (`max-age=3600`). Map renderers handle this automatically. For high-traffic apps, put a CDN (Cloudflare, Fastly, CloudFront) in front of the tile endpoint. Cache headers are already set correctly.