Deploy a map anywhere

EDK gives you a MapLibre renderer with a global Planet basemap, published feature tiles, routing, and spatial compute. The map runs in your browser and can be hosted by any static or server-rendered web platform.

Documentation navigation

Install

terminal
npm install @edk/sdk maplibre-gl
Import the map entry from @edk/sdk/map. It keeps MapLibre and PMTiles out of your application code while leaving the renderer under your control.

Create a map

map.ts
import { createMap } from "@edk/sdk/map";
import "maplibre-gl/dist/maplibre-gl.css";

const map = createMap({
  container: "map",
  center: [-73.99, 40.74],
  zoom: 11,
});

await map.addFeatures(["restaurant", "accidents"]);
await map.route({
  locations: [
    { lat: 40.74, lon: -73.99 },
    { lat: 40.71, lon: -74.01 },
  ],
  mode: "walking",
});

map.destroy();

If you already have an EDK client, use e2.map.create({ ... }) so search, routing, compute, and map layers share the same client configuration.

Use your own tile URL

map.ts
const map = createMap({
  container: "map",
  planetSource: "https://tiles.example.com/basemaps/planet.pmtiles",
});
The default is https://tiles.edk.earth/basemaps/planet.pmtiles. A custom origin or CDN must support HTTP range requests and expose browser CORS headers, including Content-Range.

Where can I deploy it?

HostWhat you deployNotes
VercelYour React/Next.js appUse a public or protected route; the map still fetches tiles from planetSource.
Cloudflare PagesStatic build or SPAPair it with a proxied tile hostname for CDN delivery.
NetlifyYour frontend bundleNo special server is required for the renderer.
Own serverStatic assets and appServe the map container and JavaScript over HTTPS.

Cloudflare is optional for app hosting. It is useful as the CDN and origin shield for Planet PMTiles; it is not an access gate by itself. Add signed URLs, a Worker check, or Cloudflare Access when the tiles must be private.

Add data and analysis

layers.ts
await map.addFeature("service_requests", {
  area: "Manhattan",
  limit: 1000,
  color: "#b68cff",
});

const result = await map.compute({
  primitive: "COUNT",
  feature: "restaurant",
  region: "Manhattan",
});

Published feature PMTiles are used when available. Otherwise the SDK falls back to EDK search and adds the result as GeoJSON. Routes and GeoJSON compute results are drawn on the same MapLibre instance.

Related SDK guides