From 8929f17886ce54dbd7c3668a4e9dd2aa6a62e8cc Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 29 Aug 2023 23:20:32 +0200 Subject: [PATCH] Also change ajax calls for QSO log view to post --- application/views/interface_assets/footer.php | 35 ++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 262abec5..3affa290 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -981,18 +981,29 @@ $(document).on('keypress',function(e) { var markers = L.layerGroup(); var pos = [51.505, -0.09]; var mymap = L.map('qsomap').setView(pos, 12); - station_gridsquare != "") { ?> - $.getJSON('logbook/qralatlngjson/', function(result) { - mymap.panTo([result[0], result[1]]); - pos = result; - }) - config->item('locator')) { ?> - $.getJSON('logbook/qralatlngjson/config->item('locator'); ?>', function(result) { - mymap.panTo([result[0], result[1]]); - pos = result; - }) - + $.ajax({ + url: base_url + 'index.php/logbook/qralatlngjson', + type: 'post', + data: { +station_gridsquare != "") { ?> + qra: '', +config->item('locator')) { ?> + qra: 'config->item('locator'); ?>', + + // Fallback to London in case all else fails + qra: 'IO91WM', + + }, + success: function(data) { + result = JSON.parse(data); + if (typeof result[0] !== "undefined" && typeof result[1] !== "undefined") { + mymap.panTo([result[0], result[1]]); + pos = result; + } + }, + error: function() { + }, + }); L.tileLayer('optionslib->get_option('option_map_tile_server');?>', { maxZoom: 18,