diff options
Diffstat (limited to 'main.js')
-rw-r--r-- | main.js | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -329,3 +329,10 @@ document.getElementById('layer-topowebb_nedtonad').onchange = function(event) { const layer = event.target.checked ? 'topowebb_nedtonad' : 'topowebb'; baseMapSource.setUrl('https://minkarta.lantmateriet.se/map/topowebbcache?LAYER=' + layer); }; + +map.on('singleclick', function (event) { + const size = map.getSize(); + if (window.location !== window.parent.location && (size[0] < 576 || size[1] < 576)) { + return window.open(window.location, '_blank'); + } +}); |