From 9846a196171aabb7519b62101d96dcd46780407a Mon Sep 17 00:00:00 2001 From: phl0 Date: Sun, 12 Jun 2022 13:45:25 +0200 Subject: [PATCH] Delete not needed ajax stuff and debug output --- application/views/interface_assets/footer.php | 40 ++++++++----------- assets/js/leaflet/L.Maidenhead.activators.js | 1 - 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index ae4b1cdb..93e88927 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -589,39 +589,31 @@ function showActivatorsMap(call, count, grids) { let re = /,/g; grids = grids.replace(re, ', '); - $.ajax({ - url: base_url+'index.php/qrbcalc/calculate', - type: 'post', - data: {'grids': "test"}, - success: function (html) { - var result = "Callsign: "+call+"
"; - result += "Count: "+count+"
"; - result += "Grids: "+grids+"

"; + var result = "Callsign: "+call+"
"; + result += "Count: "+count+"
"; + result += "Grids: "+grids+"

"; - $(".activatorsmapResult").html(result); + $(".activatorsmapResult").html(result); - // If map is already initialized - var container = L.DomUtil.get('mapactivators'); + // If map is already initialized + var container = L.DomUtil.get('mapactivators'); - if(container != null){ - container._leaflet_id = null; - } + if(container != null){ + container._leaflet_id = null; + } - const map = new L.map('mapactivators').setView([30, 0], 1.5); + const map = new L.map('mapactivators').setView([30, 0], 1.5); - var grid_four = grids.split(', '); + var grid_four = grids.split(', '); - var maidenhead = new L.maidenheadactivators(grid_four).addTo(map); + var maidenhead = new L.maidenheadactivators(grid_four).addTo(map); - var osmUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; - var osmAttrib='Map data © OpenStreetMap contributors'; - var osm = new L.TileLayer(osmUrl, {minZoom: 1, maxZoom: 9, attribution: osmAttrib}); + var osmUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; + var osmAttrib='Map data © OpenStreetMap contributors'; + var osm = new L.TileLayer(osmUrl, {minZoom: 1, maxZoom: 9, attribution: osmAttrib}); - map.addLayer(osm); - - } - }); + map.addLayer(osm); } // This displays the dialog with the form and it's where the resulttable is displayed diff --git a/assets/js/leaflet/L.Maidenhead.activators.js b/assets/js/leaflet/L.Maidenhead.activators.js index 4b6e585e..e23030d4 100644 --- a/assets/js/leaflet/L.Maidenhead.activators.js +++ b/assets/js/leaflet/L.Maidenhead.activators.js @@ -65,7 +65,6 @@ L.MaidenheadActivators = L.LayerGroup.extend({ if(grid_four.includes(this._getLocator(lon,lat,map))) { this.addLayer(L.rectangle(bounds, {className: 'grid-rectangle grid-confirmed', color: 'rgba(144,238,144, 0.6)', weight: 1, fillOpacity: 1, fill:true, interactive: false})); } - console.log('Zoom: '+zoom); if (zoom < 2 || zoom > 4) { this.addLayer(this._getLabel(lon+unit-(unit/lcor),lat+(unit/2)+(unit/lcor*c), map));