Mapbox and MapLibre both provide an option for the map object to show parameters in the URL. Setting this "hash" option to true shows the center (lat, lon), zoom, bearing and pitch information in the URL. It can be set like this:
var map = new mapboxgl.Map({
// ...
hash: true
});
In the documentation is stated, that an additional string can be provided to indicate a hash that is parameter based. In my application I have a menu to toggle layers and I would like to put that information within the URL. I cannot find a way how to set this custom hash string. Whenever a toggled layers event is registered, I could easily adapt this string which should then be updated in the URL as well.
I could not find any examples in the documentation and also not in the web.