Github Action to generate Hong Kong PMTiles every few days automatically and publish to Github Pages, and (optionally) Cloudflare R2
Fork this repo, setup GitHub pages and make sure you have Actions enabled :) You might also want to use https://github.com/marketplace/actions/keepalive-workflow to keep your fork alive, preventing the scheduled actions from being disabled
To host the tiles in Cloudflare R2, it is required to set the below secrets for the forked repository following the Github instructions.
| Name | Description |
|---|---|
| R2_ACCOUNT_ID | Your Cloudflare account ID. |
| R2_ACCESS_KEY_ID | Your Cloudflare R2 bucket access key ID. |
| R2_SECRET_ACCESS_KEY | Your Cloudflare R2 bucket secret access key. |
| R2_BUCKET | Your Cloudflare R2 bucket name. |
The tilesets that power the generated PMTiles are Produced Works of the OpenStreetMap dataset under the Open Database License. Web maps and native apps that use this Produced Work must visibly attribute © OpenStreetMap - for example, in the corner of the map display.
When manually triggering the workflow, uncheck any of these options:
- Build vector tiles
- Build labels tiles
- Build raster light tiles
- Build raster dark tiles
Set repository variables in Settings → Secrets and variables → Actions → Variables:
CRON_BUILD_VECTORCRON_BUILD_LABELSCRON_BUILD_RASTER_LIGHTCRON_BUILD_RASTER_DARK
If variables are not set, all tile types will be generated
The default styles are adopted from Protomaps with slight modifications so it looks better in lower resolutions.
You may adjust the styles by modifying the files render-style.json and render-style-dark.json.