Hi, I use the official style map from https://www.openhistoricalmap.org/map-styles/main/main.json
I want to change colors and remove some layers. I then want to embed using leaflet (OpenHistoricalMap/Reuse - OpenStreetMap Wiki)
Is there a way to define the date filter (single year) within the main.json?
Can I add the language (I want to use de) within that main.json?
If not, how can I set the language within JS? For the date filter there is the info on the reuse information page I linked above
Ok, for now I use JS for both: date filter (single date) + language definition
function setupMaplibreLayerEvents(glLayer) {
const maplibreMap = glLayer.getMaplibreMap();
maplibreMap.once('styledata', function (event) {
maplibreMap.filterByDate('1945-12-31');
// Set labels to German (name:de), fallback to default name
maplibreMap.getStyle().layers.forEach(layer => {
if (layer.layout && layer.layout['text-field']) {
maplibreMap.setLayoutProperty(layer.id, 'text-field', [
'coalesce',
['get', 'name_de'],
['get', 'name']
]);
}
});
});
}