Skip to main content
GuidesAPI ReferenceExamples

Vector Tiles API

|



The Vector Tiles API provides access to Magic Lane vector map tiles in Slippy tile format.

Authentication Required

All requests to the Vector Tiles API require authentication. Include your API token in the Authorization header.


Endpoint: GET /tiles/{zoom}/{x}/{y}.{format}

Base URL: https://api.magiclane.net/api/v1

Path Parameters

ParameterTypeRequiredDescription
zoomintegerYesTile zoom level. Higher values provide more detail.
xintegerYesTile column in Slippy tile format.
yintegerYesTile row in Slippy tile format.
formatstringYesOutput format. Supported values: mvt, pbf.

Authentication

The API supports two authentication methods:

MethodParameterLocationExample
HeaderAuthorizationRequest header-H "Authorization: YOUR_API_TOKEN"
Query ParameterauthTokenURL query string?authToken=YOUR_API_TOKEN

Response

The API returns a vector tile in the requested format. Vector tiles use the Mapbox Vector Tile (MVT) specification and contain encoded geographic features that can be rendered by compatible map libraries.

Response Headers

HeaderDescription
Content-Typeapplication/vnd.mapbox-vector-tile for .mvt format

Example Requests

Using Authorization header:

curl -X GET "https://api.magiclane.net/api/v1/tiles/2/2/1.mvt" \
-H "Authorization: YOUR_API_TOKEN" \
--output 2_2_1.mvt

Using query parameter:

curl -X GET "https://api.magiclane.net/api/v1/tiles/2/2/1.mvt?authToken=YOUR_API_TOKEN" \
--output 2_2_1.mvt

Both examples request a vector tile at zoom level 2, column 2, row 1 in MVT format.

Understanding Slippy Tile Coordinates

Slippy tiles use a coordinate system where:

  • Zoom level: Determines the map detail level. At zoom 0, the entire world is a single tile. Each zoom level doubles the number of tiles in each dimension.
  • X coordinate: The tile column, starting from 0 at the left (west) edge.
  • Y coordinate: The tile row, starting from 0 at the top (north) edge.

The number of tiles at each zoom level is 2^zoom × 2^zoom. For example:

  • Zoom 0: 1 tile (the entire world)
  • Zoom 1: 4 tiles (2×2)
  • Zoom 2: 16 tiles (4×4)

Supported Formats

FormatExtensionDescription
Mapbox Vector Tile.mvtStandard vector tile format, widely supported by mapping libraries.
Protocol Buffers.pbfBinary format, equivalent to MVT.

Both formats contain the same data and can be used interchangeably.

Error Responses

HTTP StatusDescription
400Bad Request - Invalid parameters.
403Forbidden - Invalid or missing authentication token.
404Not Found - The requested tile does not exist.
503Service Unavailable - The service is temporarily unavailable.