# Map Tile Maths Web Mercator and slippy-map tile maths: tile numbers, bounds, quadkeys, ground resolution, zoom for an extent, tile counts and scale. ## How to pay Machine-payable over x402. USDC on: Base (eip155:8453), Solana (solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp), Polygon (eip155:137), Arbitrum One (eip155:42161). No accounts. No API keys. No signup. The paying wallet is the account. ## Machine-readable - OpenAPI: https://map-tiles.x402tookit.com/openapi.json - x402 manifest: https://map-tiles.x402tookit.com/.well-known/x402 - Catalog (free): https://map-tiles.x402tookit.com/catalog - Health (free): https://map-tiles.x402tookit.com/health - Uptime (free): https://map-tiles.x402tookit.com/uptime ## Endpoints (8) ### GET /ground-resolution — $0.02 Metres per pixel, map scale (1:N) and tile width on the ground for a zoom level and latitude. Params: zoom: integer, latitude?: number, tileSize?: integer, dpi?: number Example: https://map-tiles.x402tookit.com/ground-resolution?zoom=10&latitude=51.5 ### GET /mercator-project — $0.02 Convert latitude/longitude to Web Mercator EPSG:3857 metres, or metres back to degrees, with scale distortion. Params: latitude?: number, longitude?: number, x?: number, y?: number Example: https://map-tiles.x402tookit.com/mercator-project?latitude=51.5074&longitude=-0.1278 ### GET /quadkey — $0.02 Convert a tile x/y/z to a Bing Maps quadkey, or a quadkey back to x/y/z, with its parent and four children. Params: quadkey?: string, zoom?: integer, x?: integer, y?: integer Example: https://map-tiles.x402tookit.com/quadkey?zoom=3&x=3&y=5 ### GET /tile-bounds — $0.02 Latitude/longitude and EPSG:3857 metre bounds of a slippy-map tile x/y/z, with its centre and ground size. Params: zoom: integer, x: integer, y: integer Example: https://map-tiles.x402tookit.com/tile-bounds?zoom=10&x=511&y=340 ### GET /tile-count — $0.02 Number of slippy-map tiles covering a lat/lon box for a zoom range, with a rough storage estimate at your average tile size. Params: west: number, south: number, east: number, north: number, minZoom?: integer, maxZoom: integer, avgTileKB?: number Example: https://map-tiles.x402tookit.com/tile-count?west=-0.5&south=51.3&east=0.3&north=51.7&minZoom=8&maxZoom=14 ### GET /tile-from-coord — $0.02 Slippy-map tile x/y/z containing a latitude and longitude, plus the pixel position inside the 256 px tile. Params: latitude: number, longitude: number, zoom: integer Example: https://map-tiles.x402tookit.com/tile-from-coord?latitude=51.5074&longitude=-0.1278&zoom=10 ### GET /zoom-for-extent — $0.02 Highest map zoom level at which a lat/lon bounding box fits a viewport of given pixel size, with centre and tile span. Params: west: number, south: number, east: number, north: number, viewportWidth?: integer, viewportHeight?: integer, paddingPx?: integer Example: https://map-tiles.x402tookit.com/zoom-for-extent?west=-0.5&south=51.3&east=0.3&north=51.7&viewportWidth=800&viewportHeight=600 ### GET /zoom-table — $0.02 Zoom-level ladder 0 to 24: tiles per side, metres per pixel, map scale and typical use, at a chosen latitude. Params: latitude?: number, dpi?: number, fromZoom?: integer, toZoom?: integer Example: https://map-tiles.x402tookit.com/zoom-table?latitude=45&fromZoom=0&toZoom=20 ## Terms Map projection and tile arithmetic computed locally from the numbers given, per the Web Mercator (EPSG:3857) and slippy-map conventions, provided as is. Web Mercator distorts size and distance away from the equator and is undefined beyond about 85.0511 degrees latitude. Tile servers have their own usage terms: this shelf never fetches tiles. Not survey-grade.