From b4716930d66e380c0bffd0e67937768a9f98b39e Mon Sep 17 00:00:00 2001 From: Batareiken Date: Sun, 28 Apr 2024 07:58:56 +0000 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B0=D0=B9=D0=BC=D0=B5=D1=80=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BE=D1=82=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA=D1=83?= =?UTF-8?q?=20geoip=20=D1=81=D0=BA=D1=80=D0=B8=D0=BF=D1=82=D0=B0.=20=D0=9F?= =?UTF-8?q?=D0=BE=D0=B7=D0=B8=D1=86=D0=B8=D1=8F=20=D0=BF=D0=BE=20=D1=83?= =?UTF-8?q?=D0=BC=D0=BE=D0=BB=D1=87=D0=B0=D0=BD=D0=B8=D1=8E=20=E2=80=94=20?= =?UTF-8?q?=D0=9C=D0=BE=D1=81=D0=BA=D0=B2=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Браузер пользователя бесконечно долго ждал ответа, если сайт geoip сервиса не отвечал. Последующие скрипты не отрабатывали. Карта с объектами не загружалась. --- htdocs/public/index.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/public/index.php b/htdocs/public/index.php index 2425bbc..adf9638 100644 --- a/htdocs/public/index.php +++ b/htdocs/public/index.php @@ -97,11 +97,11 @@ options['animate'] = true; // Use Stockholm as default position (will be used if we fail to fetch location from ip-location service) - options['defaultLatitude'] = '59.30928'; - options['defaultLongitude'] = '18.08830'; + options['defaultLatitude'] = '55.74000'; + options['defaultLongitude'] = '37.60600'; // Tip: request position from some ip->location service (https://freegeoip.app/json and https://ipapi.co/json is two examples) - $.getJSON('https://ipapi.co/json', function(data) { + $var geoip0 = $.getJSON('https://ipapi.co/json', function(data) { if (data.latitude && data.longitude) { options['defaultLatitude'] = data.latitude; options['defaultLongitude'] = data.longitude; @@ -148,6 +148,7 @@ alert('This service require HTML 5 features to be able to feed you APRS data in real-time. Please upgrade your browser.'); } }); + setTimeout(function(){geoip0.abort();}, 2000); });