TRAILSPLITS · DEVELOPER PREVIEW

From a public request to a useful result

Three small integrations: a pinned outdoor map, a sampled elevation profile and a route with explicit settings. Run a live request, inspect the evidence, then reproduce it in a clean project.

Download the minimal example project (.zip)

No key required for these examples (calls without a key get 500 credits a day per address). Use follows the API terms: commercial use is allowed with attribution on the Free plan. No coordinates are sent by these demos until you explicitly run them.

01 · DISPLAY A MAP

A pinned outdoor map with terrain

The manifest names the basemap, style, glyphs, sprite and terrain independently. The sample pins the dependencies used by the style and reads PMTiles in byte ranges. The current text-only style needs no sprite image; its unused placeholder is omitted and recorded in the evidence.

Start the fixed Dolomites view to fetch the published assets.

No map requests until you choose Load live map.

Fixed center 12.1352° E, 46.5369° N; z12, pitch 55°. At most 128 asset requests / 16 MiB, 2 MiB per asset, plus two JSON requests of at most 256 KiB each. Loading stops after 20 seconds. No whole-planet download or background pan/zoom requests.

Copy the integration and inspect its evidence
Map integration
import { startMap } from "./map-client.ts";
const controller = new AbortController();
const stop = await startMap(document.querySelector("#map"),
  controller.signal, console.log, console.error);
// stop() removes the map and aborts its asset requests.

Map artifact evidence
Not run.

A missing manifest, retired version, failed asset, unhonoured Range request or exhausted example budget leaves an error, rather than an unlabelled fallback. Source dates can be unknown. Versions are retained addresses, not indefinite retention guarantees.

Integration follows PMTiles’ MapLibre integration and MapLibre custom protocols. The downloadable client includes request bounds and visibly retains OpenMapTiles, OpenStreetMap and DEM credits.

02 · INSPECT ELEVATION

A profile with visible missing-data gaps

The client chooses equally spaced samples along your supplied line. The server samples one terrain pixel at each point. This does not locate a trail, smooth a profile or add resolution to the DEM.

No request yet. The default is a short controlled line near Cortina, not a mapped itinerary.

Example bounds: 2–8 input vertices, 1 m–5 km total line length, 8/16/32 samples. At most two 256 KiB JSON requests, each with a 12-second timeout. Input uses lon,lat; the generated sampling URL uses lat,lon. Sampling at z12 can exceed source detail; closely spaced samples do not imply surveyed accuracy.

Working with a GPX file? Open the Elevation Profile tool to inspect your file. This link transfers no geometry; the tool has its own sampling and analysis workflow.

Copy request, result and provenance
Profile request
Run the example to resolve a published terrain version and build the request.

Profile result
Not run.

Terrain and contours produced using Copernicus WorldDEM-30 © DLR e.V. 2010-2014 and © Airbus Defence and Space GmbH 2014-2018 provided under COPERNICUS by the European Union and ESA; all rights reserved

03 · CALCULATE A ROUTE

Explicit settings, inspectable geometry

This uses the public api.trailsplits.com/route/v1 gateway. Its Valhalla-compatible input subset returns OSRM-shaped routes; it is a different HTTP contract from the Planner’s site endpoint.

No request yet. Start with an explicit walking profile and T3 cap.

Two endpoints, 1 m–5 km straight-line separation; one request, 256 KiB response ceiling, 12-second timeout. Routing distance is metres; duration is seconds. The tile stamp is result provenance, not a release-pinning request. Car requests return 400; 422 and 503 can also be refusals. No failure is converted into a straight-line route.

Copy request, GeoJSON result and engine evidence
Routing request
Run to build a validated request.

Routing GeoJSON
Not run.

Inspect current routing capabilities · Explore this area in the Planner. The Planner link positions the map only: it does not pass these endpoints/settings or promise the same route.

Putting a map on a website?

For an existing race course, trail or public route, start with the website map guide or see widgets on example websites. The existing builder gives you a preview and HTML to paste, without writing an API client.

For a custom application, use the developer examples above and check the API plans and terms. Widget publication and direct API integration have different contracts; a working preview does not grant commercial API rights.

Reproduce it in a clean project

The zip contains the same request, sampling, decoding and bounded map-consumer code as this page. It includes a plain HTML/Vite map and twelve Node scripts; no SDK or account setup.

Clean project commands
unzip trailsplits-developer-examples.zip -d trailsplits-examples
cd trailsplits-examples
npm install
npm run dev -- --host 127.0.0.1
# Load the map explicitly in the opened browser.
node elevation.mjs
node elevation.mjs --missing-fixture
node routing.mjs
node routing.mjs --refusal
node weather.mjs
node analysis.mjs
node roundtrip.mjs
node routeweather.mjs
node places.mjs
node matching.mjs
node staticmap.mjs
node snow.mjs
node profile.mjs
node gpx.mjs

Use Node 22 or newer. Dependency versions are pinned in the sample package. Published artifacts may be retired, and dynamic routing can change; reproduction targets the documented class of result. The README documents bounds, attribution and failure paths.

Download examples · Full API reference and preview policy