From 7879bf6dfa34bfd37f895f751deeb628f70c2835 Mon Sep 17 00:00:00 2001 From: grin Date: Tue, 25 Apr 2017 10:37:40 +0200 Subject: [PATCH 1/2] Insert JOSM/SSL remote control --- osmtm/static/js/project.js | 37 +++++++++++++++++++++++++++++-- osmtm/templates/task.editors.mako | 1 + 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/osmtm/static/js/project.js b/osmtm/static/js/project.js index 2468cd65..3312acff 100644 --- a/osmtm/static/js/project.js +++ b/osmtm/static/js/project.js @@ -107,7 +107,9 @@ osmtm.project = (function() { lmap = L.map('leaflet'); L.control.scale().addTo(lmap); // create the tile layer with correct attribution - var osmUrl='//tile-{s}.openstreetmap.fr/hot/{z}/{x}/{y}.png'; +// var osmUrl='//tile-{s}.openstreetmap.fr/hot/{z}/{x}/{y}.png'; + var osmUrl='//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; + var osmAttrib=osmAttribI18n; var osm = new L.TileLayer(osmUrl, {attribution: osmAttrib}); lmap.addLayer(osm); @@ -393,7 +395,7 @@ osmtm.project = (function() { if (typeof imagery_url != "undefined" && imagery_url !== '') { source=encodeURIComponent(imagery_url); } else { - source="Bing"; + source="ortofoto-undef"; } return options.base + decodeURIComponent($.param({ left: roundd(bounds[0],5), @@ -454,6 +456,37 @@ osmtm.project = (function() { } }); break; + case "josmssl": + if (typeof licenseAgreementUrl != 'undefined') { + alert(requiresLicenseAgreementMsg); + window.location = licenseAgreementUrl; + break; + } + url = getLink({ + base: 'https://127.0.0.1:8112/load_and_zoom?', + bounds: task_bounds, + protocol: 'lbrt' + }); + $.ajax({ + url: url, + complete: function(t) { + if (t.status != 200) { + alert(josmRcDidNotRespondI18n); + } else { + if (typeof imagery_url != "undefined" && imagery_url !== '') { + $.ajax({ + url: 'https://127.0.0.1:8112/imagery', + data: { + title: "Tasking Manager - #" + project_id, + type: imagery_url.toLowerCase().substring(0,3), + url: imagery_url + } + }); + } + } + } + }); + break; case "potlatch2": url = getLink({ base: 'http://www.openstreetmap.org/edit?editor=potlatch2&', diff --git a/osmtm/templates/task.editors.mako b/osmtm/templates/task.editors.mako index 5e80d59e..1d67ec24 100644 --- a/osmtm/templates/task.editors.mako +++ b/osmtm/templates/task.editors.mako @@ -12,6 +12,7 @@