Skip to content

OpenHistoricalMap/map-styles

Repository files navigation

Open Historical Map Styles

This repository contains vector map styles that can be applied to OHM vector tiles.

The tile source is https://vtiles.openhistoricalmap.org/.

Here, you can save your worries about tile servers and data updates and instead just load a JSON file into https://maputnik.github.io/ and make some updates!

Style file to load in Maputnik:

Note that we may disable these Github.io links in the future, so do not reference them in external applications.

Copy the vector-based style to your Mapbox account here. Note: the data layers are a little different because Mapbox uses Streets v8 now, and OHM styles are on Streets v7, but the style elements are all there.

If you make changes you want to commit back here:

  1. Clone the repo locally.
  2. Load the style file.
  3. Use Export to write a new JSON over the top of the old one on your local copy (or save a new style).
  4. Commit and push the changes, which will then be available at a GH Pages URL similar to the one above.

If you make a new style, just change the URL for the style file with the new one you made.

Note that changes here do not publish automagically to the OHM website. The styles are published via an NPM module, which is then consumed by the website.

Review styles locally

With the move to npm packaging it's now possible to view and switch between map styles locally. The first time you git clone this repository be sure to run nvm use (install Node version if needed) and then run npm install. Afterward, running npm test will start the lightweight http-server and launch a new browser window on port 8888.

Use control-c to end the browser session.

This is a new feature, with two known issues/milestones:

  • the OpenHistoricalMap timeslider is not yet incorporated; it, too, is being readied for npm packaging
  • it would be better if the local port were configurable by individual users. This is complicated slightly as our staging and production deployment process searches-and-replaces http://localhost:8888/ with urls suitable for those environments.

Versioning and publishing to npm

Review styles while they are in staging

To review the styles with the latest updates to the map-styles repo before they are live, use the below links. These are pulled from the staging branch. The staging branch will reflect 1) recently made updates before they are merged into main and occasionally 2) iterative cartography testing.

To see a specific year in history, change the target year in the URL: