Skip to content

Latest commit

 

History

History
 
 

README.md

Allmaps Tile Server

Allmaps Tile Server is a proxy server that turns Georeference Annotations into XYZ map tiles.

Allmaps Tile Server runs on Cloudflare Workers. Cloudflare Workers let you run tiny JavaScript programs on Cloudflare's global CDN. Cloudflare is working on publishing the Workers system as open source.

For more information, see https://observablehq.com/@allmaps/allmaps-tile-server.

Some example URLs:

Development

Run locally with Miniflare:

pnpm run dev

A local version of Allmaps Tile Server is now running on http://localhost:5504.

Some example URLs for local development:

Publish to Cloudflare Workers:

wrangler publish

API

Supplying a Georeference Annotation

To generate XYZ map tiles, Allmaps Tile Server needs a Georeference Annotation. You can supply a Georeference Annotation in three ways:

  1. By using the URL of a Georeference Annotation
  2. By using the Allmaps ID of a georeferenced map
  3. By supplying a complete URL-encoded Georeference Annotation

The different ways of supplying a Georeference Annotation are explained in detail below.

By using the URL of a Georeference Annotation

We can download an example Georeference Annotation of a map of Coney Island from the NYPL from Allmaps API:

You can turn this Georeference Annotation into XYZ tiles like this:

Allmaps Tile Server also supports TileJSON:

Note: Allmaps Tile Server does not depend on https://annotations.allmaps.org. You can use Georeference Annotations from any URL.

By using the Allmaps ID of a georeferenced map

If Allmaps has georeference data available about a certain IIIF resource and you know its Allmaps ID, you can also use this ID directly. If you don't know its Allmaps ID, you can use https://annotations.allmaps.org to search for the URL of a specific IIIF resource:

You can find out the Allmaps ID of all the maps in a georeferenced image like this:

This image contains one map, with ID 25b0d49e1b659498. The XYZ tile URL of this map is:

And for TileJSON:

By supplying a complete URL-encoded Georeference Annotation

Instead of the URL of a Georeference Annotation, you can also supply the URL-encoded contents of the Georeference Annotation using the annotation URL parameter:

And for TileJSON:

Retina tiles

All PNG and TileJSON URLs are also available in a 512 × 512 pixel retina version. To get retina tiles, add @2x to the end of the URL:

URL parameters

Parameter Description Allowed values Example
transformation.type Transformation type "polynomial" | "thin-plate-spline" ?transformation.type=polynomial