States Tiles

Vector tiles for US state boundaries and labels. Ideal for thematic maps, state-level aggregations, and administrative overlays.

Endpoint

GEThttps://api.landmapmagic.com/v1/tiles/states/{z}/{x}/{y}.mvt

Returns a Mapbox Vector Tile containing state polygon geometries and label points. Zoom range: 0 – 6.

URL Parameters

Parameters

NameTypeDescription
z*numberZoom level (0-6).
x*numberTile X coordinate.
y*numberTile Y coordinate.
key*stringYour API key.

Source Layers

Source Layers

statesState polygon boundaries.z0-6
states_labelsState label points (centroids).z0-6

Attributes

Available Attributes

AttributeTypeDescription
idnumberUnique internal feature identifier.
NAMEstringFull state name (e.g. "Iowa").
STUSPSstringTwo-letter USPS state abbreviation (e.g. "IA").
STATEFPstringTwo-digit FIPS state code (e.g. "19").

Code Examples

curl
curl "https://api.landmapmagic.com/v1/tiles/states/4/3/6.mvt?key=YOUR_API_KEY" \
  --output tile.mvt
JavaScript
const response = await fetch(
  "https://api.landmapmagic.com/v1/tiles/states/4/3/6.mvt?key=YOUR_API_KEY"
);
const data = await response.arrayBuffer();
console.log("Tile size:", data.byteLength, "bytes");
Python
import requests

response = requests.get(
    "https://api.landmapmagic.com/v1/tiles/states/4/3/6.mvt",
    params={"key": "YOUR_API_KEY"}
)
print(f"Status: {response.status_code}, Size: {len(response.content)} bytes")

Response

Response Headers

HTTP/1.1 200 OK
Content-Type: application/vnd.mapbox-vector-tile
Content-Encoding: gzip
Cache-Control: public, max-age=86400

The response body is a binary MVT protobuf. Use a vector tile library such as deck.gl MVTLayer, Mapbox GL JS, or maplibre-gl to decode and render the tile.

Styles

Fetch a renderer-ready style for the States layer from the unified /v1/styles endpoint. The response includes sources, layers, attribution, zoom ranges, and label deduplication baked in. Use the landmapmagic npm package for one-line install per target, or call the API directly.

MapLibre / Mapbox

Identical payload either way — Mapbox GL JS consumes a MapLibre Style Spec v8 doc as-is. Pick the keyword that reads best in your codebase.

URL (maplibre)
GET https://api.landmapmagic.com/v1/styles?target=maplibre&layers=states&key=YOUR_API_KEY
URL (mapbox)
GET https://api.landmapmagic.com/v1/styles?target=mapbox&layers=states&key=YOUR_API_KEY
JavaScript
const style = await fetch(
  'https://api.landmapmagic.com/v1/styles?' +
    new URLSearchParams({
      key: 'YOUR_API_KEY',
      target: 'maplibre', // or 'mapbox' — same response
      layers: 'states',
    })
).then((r) => r.json());

map.setStyle(style);

Leaflet

URL
GET https://api.landmapmagic.com/v1/styles?target=leaflet&layers=states&key=YOUR_API_KEY
JavaScript
import { mountLeafletLandMap } from 'landmapmagic/leaflet';

await mountLeafletLandMap({
  apiKey: 'YOUR_API_KEY',
  map,
  layers: ['states'],
});

Google + deck.gl

URL
GET https://api.landmapmagic.com/v1/styles?target=google&layers=states&key=YOUR_API_KEY
JavaScript
import { mountGoogleLandMap } from 'landmapmagic/google';

await mountGoogleLandMap({
  apiKey: 'YOUR_API_KEY',
  map,
  overlay,
  layers: ['states'],
});
State boundaries cover the 50 US states and the District of Columbia. US territories (Puerto Rico, Guam, US Virgin Islands, American Samoa, and Northern Mariana Islands) are excluded from this layer.