2021-02-17 14:23:49 +08:00
2021-02-17 14:23:49 +08:00
2021-02-16 16:30:58 +08:00
2021-02-16 16:36:33 +08:00
2021-02-16 19:03:47 +08:00

PMTiles

PMTiles is a single-file archive format for tiled data. A PMTiles archive can be hosted on a commodity storage platform such as S3, and enables low-cost, zero-maintenance map applications that are "serverless" - free of a custom tile backend or third party provider.

For those familiar with Cloud Optimized GeoTIFFs - PMTiles uses similar techniques, but is specific to Z/X/Y tiles and can store vector data.

Map Libraries

Leaflet

MapLibre GL

Storage Providers

PMTiles files require servers to support HTTP byte serving as well as CORS. It's been tested with:

Amazon S3

  1. From your S3 Bucket's "Permissions" tab, scroll to the Cross-origin resource sharing (CORS) editor.

  2. Add this JSON policy, replacing "https://example.com" with your domains or "*" for all domains. See The S3 CORS documentation.

    [ { "AllowedHeaders": ["Range"], "AllowedMethods": ["GET","HEAD"], "AllowedOrigins": ["https://example.com"] } ]

  3. Ensure that your S3 objects have public read access.

Google Cloud

Azure

  • HEAD requests for ranges return 200 instead of 206
  • Configuration through Web Portal

DigitalOcean Spaces

Backblaze B2

  • See B2 CORS Rules

    [ { "corsRuleName": "allowHeaders", "allowedOrigins": ["https://example.com"], "allowedOperations":["b2_download_file_by_name"], "allowedHeaders": ["range"], "maxAgeSeconds": 300 } ]

Description
No description provided
Readme BSD-3-Clause 24 MiB
Languages
TypeScript 51.5%
Python 29.1%
C++ 8.8%
HTML 5.2%
C 4.1%
Other 1.3%