hmplot/tiles
Load, place and style vector tiles yourself; the VectorTile mark does all of it for you.
JavaScript only.
import { tileAt, tileBounds, loadVectorTiles, DEFAULT_TILES } from "hmplot/tiles";
const tile = tileAt([-73.99, 40.73], 12); // [12, 1206, 1539]
const [west, south, east, north] = tileBounds(tile);
const features = await loadVectorTiles(DEFAULT_TILES.url, [tile]);Usage
The VectorTile mark loads, decodes, places and styles tiles itself, from tile, tiles or a bounds box, or following the view. These helpers are for doing a part of that yourself: finding the tiles for a place (tileAt, tileBounds), loading them once and passing the result as VectorTile’s data or to a GeoJSON mark (loadVectorTiles), placing other data in the meters of a local map (localPlane), or styling a basemap from a theme (vectorTileScheme).
Tile coordinates are the standard XYZ (“slippy map”) ones: zoom, then the column from the west and the row from the north, in Web Mercator. DEFAULT_TILES needs no key and allows any origin; show its attribution wherever the tiles are shown, as their licenses ask. Another tile server’s url is a template with {z}, {x} and {y}, as in its documentation. See docs/VECTOR-TILES.md.
These helpers are JavaScript only. In Python, VectorTile takes tile, tiles and bounds the same way, and exported pages embed the tiles they drew.