From 3238cf9e3049dbc2832422fca8251c1e68920b80 Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Mon, 30 Aug 2021 00:29:58 +0200 Subject: [PATCH] Enable switch on/off background map in mappy --- static/mappy-area.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/static/mappy-area.js b/static/mappy-area.js index 924165c..74fa36b 100644 --- a/static/mappy-area.js +++ b/static/mappy-area.js @@ -12,6 +12,8 @@ function html_mappy_area(area) "<- list": "javascript:go_to(\"list\")", "statistics": "javascript:go_to(\"stats\", " + aid + ")", "how to mappy": "javascript:how_to_mappy()", + "no background": "javascript:no_background()", + "osm backrgound": "javascript:osm_background(" + aid + ")", }; if (!api.token()) nav_links["authenticate"] = "javascript:api.auth()"; var tags = area["tags"]; @@ -73,6 +75,17 @@ function how_to_mappy() ih += ""; up("damn_info", ih); } +function no_background() +{ + var sm = document.getElementById("svg_map"); + sm.style.backgroundImage = "none"; +} +function osm_background(aid) +{ + var sm = document.getElementById("svg_map"); + var img_url = "url('https://osmsm.damn-project.org/" + aid + ".png')"; + sm.style.backgroundImage = img_url; +} function act_square(e, aid, sid) { e = e || window.event; -- 2.34.2