diff options
-rw-r--r-- | main.js | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -468,17 +468,17 @@ if (window.location !== window.parent.location) { container.setAttribute('aria-hidden', 'false'); view.on('change', function(event) { - const popover = Popover.getInstance(popup); - if (popover !== null) { - popover.dispose(); - } + const popover = Popover.getInstance(popup); + if (popover !== null) { + popover.dispose(); + } - const coordinates = view.getCenter(); - const searchParams = new URLSearchParams(location.hash.substring(1)); - searchParams.set('x', coordinates[0].toFixed(2).replace(TRAILING_ZEROES, '')); - searchParams.set('y', coordinates[1].toFixed(2).replace(TRAILING_ZEROES, '')); - searchParams.set('z', view.getZoom().toFixed(3).replace(TRAILING_ZEROES, '')); - location.hash = '#' + searchParams.toString(); + const coordinates = view.getCenter(); + const searchParams = new URLSearchParams(location.hash.substring(1)); + searchParams.set('x', coordinates[0].toFixed(2).replace(TRAILING_ZEROES, '')); + searchParams.set('y', coordinates[1].toFixed(2).replace(TRAILING_ZEROES, '')); + searchParams.set('z', view.getZoom().toFixed(3).replace(TRAILING_ZEROES, '')); + location.hash = '#' + searchParams.toString(); }); |