Таймер на отработку geoip скрипта. Позиция по умолчанию — Москва.
Браузер пользователя бесконечно долго ждал ответа, если сайт geoip сервиса не отвечал. Последующие скрипты не отрабатывали. Карта с объектами не загружалась.
This commit is contained in:
parent
aa7b04e591
commit
b4716930d6
|
|
@ -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);
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
|||
Loading…
Reference in New Issue