@tileflow/core
@tileflow/core
Define and customize maps in TypeScript, then compile them to MapLibre Style JSON. Start from an official Tileflow map or create your own, with typed settings for themes, roads, buildings, labels, and other map features.
Use Core to author and validate the map and the Tileflow CLI to preview it. Display it with
@tileflow/dom
or a framework adapter.
Install
The SDK is in alpha. Use ES modules and Node.js 22.14+ (22.x) or 24+ for the CLI.
npm install --save-exact @tileflow/core@alpha @tileflow/maps@alpha
npm install --save-dev --save-exact tileflow@alpha
@tileflow/maps supplies the official Streets map used below. Keep your package-manager lockfile.
Define your first map
Create tileflow.config.ts in your project:
import {defineMap, labels, roads} from '@tileflow/core';
import {streets} from '@tileflow/maps';
export default defineMap({
id: 'madrid',
name: 'Madrid',
version: 1,
extends: streets,
modules: {
roads: roads({detail: 'streets', hierarchy: 'clear'}),
labels: labels({roads: 'major'}),
},
view: {center: [-3.7038, 40.4168], zoom: 12},
});
This keeps Streets' themes and assets, customizes its roads and labels, and opens over Madrid.
Coordinates are [longitude, latitude]. Each config exports one map.
Preview it
npx tileflow validate
npx tileflow preview
Open the local URL printed by the CLI. Change the starting zoom, save, and reload the preview
to see the result. Stop the server with Ctrl+C.
Local authoring and preview need no Tileflow account or API key. Remote map tiles and assets still need a network connection.
Learn more
- Map configuration: create a map or extend an existing design.
- Themes and tokens: customize colors and switch appearances.
- Semantic modules: style roads, water, buildings, and labels.
- React, Vue, and Svelte: use your map in an application.
- Core reference: inheritance, compilation, assets, and browser/runtime contracts.
REFERENCE.md is also included in the installed package. Use that copy and its TypeScript
declarations for the behavior of your installed version.
Support and license
Report an issue or read the
full documentation. For use only with
Tileflow services, under the package's LICENSE; third-party assets retain their own terms.