1
0
forked from MTSR/mapserver
mapserver/static/js/compat.js

16 lines
428 B
JavaScript
Raw Normal View History

2019-08-30 10:59:55 +02:00
export function hashCompat(){
if (window.location.hash) {
let match = window.location.hash.match(/^#\/(\d*)\/(\d*)\/(\d*)$/m);
if (match) {
2019-09-01 12:06:47 +02:00
window.location.hash = `#!/map/0/${match[1]}/${match[2]}/${match[3]}`;
2019-08-30 10:59:55 +02:00
}
match = window.location.hash.match(/^#\/(\d*)\/(\d*)\/(\d*)\/(\d*)$/m);
if (match) {
2019-09-01 12:06:47 +02:00
window.location.hash = `#!/map/${match[1]}/${match[2]}/${match[3]}/${match[4]}`;
2019-08-30 10:59:55 +02:00
}
}
}