Further fixes to clear up the fullscreen

This commit is contained in:
Pieter Vander Vennet 2021-03-12 14:52:34 +01:00
parent 482a81b40a
commit 558265eba9
9 changed files with 50 additions and 17 deletions

View file

@ -18,7 +18,9 @@ export default class SelectedFeatureHandler {
this._featureSource = featureSource;
const self = this;
hash.addCallback(h => {
console.log("SelectedFeatureHandler: hash is now ", h)
if (h === undefined || h === "") {
console.log("Deselecting...")
selectedFeature.setData(undefined);
}else{
self.selectFeature();

View file

@ -49,6 +49,15 @@ export default class Hash {
}
hash.setData(newValue)
}
window.addEventListener('popstate', e => {
let newValue = window.location.hash.substr(1);
console.log("Popstate: the hash is now:", newValue)
if (newValue === "") {
newValue = undefined;
}
hash.setData(newValue)
})
return hash;
}