Maps icon indicating copy to clipboard operation
Maps copied to clipboard

Add option to embed OpenHistoricalMap

Open 1ec5 opened this issue 1 year ago • 1 comments

This extension’s support for Leaflet and openstreetmap-carto raster tiles is useful for some sites, but others like Housetrails, which focuses on historical geography, would benefit from maps that place the overlays in the correct time period instead of the present day. OpenHistoricalMap is a complement to OpenStreetMap that focuses on mapping history. It would be great if a site like Housetrails could embed an OHM map instead of an OSM map when a date is provided as context.

Unlike openstreetmap-carto, the main OHM map uses vector tiles that are rendered on the client side using MapLibre GL JS, but there’s a plugin for bridging the rendered style into Leaflet. openhistoricalmap.org itself uses Leaflet with this plugin.

1ec5 avatar Feb 26 '24 18:02 1ec5

Here’s some code you can use to adapt the style at runtime to filter all the layers by a given date:

https://github.com/OpenHistoricalMap/ohm-embed-1yr/blob/7780271d97293aad402b47f84eedaaf7d462d735/embed-map-single-year.js#L75-L168

1ec5 avatar Feb 27 '24 00:02 1ec5