aboutsummaryrefslogtreecommitdiffstats
path: root/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'main.js')
-rw-r--r--main.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/main.js b/main.js
index b5df865..b15a7dd 100644
--- a/main.js
+++ b/main.js
@@ -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');
+ }
+});