~qeef/damn-client.js

3238cf9e3049dbc2832422fca8251c1e68920b80 — Jiri Vlasak 1 year, 8 months ago 5fdc0d9 v0.19.3
Enable switch on/off background map in mappy
1 files changed, 13 insertions(+), 0 deletions(-)

M static/mappy-area.js
M static/mappy-area.js => static/mappy-area.js +13 -0
@@ 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 += "</ul>";
    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;