1const STATUS_URL = 'https://paikkatiedot.ymparisto.fi/gsstatus.json'; 2 3async function checkKarttapalveluStatus() { 4 try { 5 const response = await fetch(STATUS_URL, { 6 cache: 'no-store' 7 }); 8 9 if (!response.ok) { 10 throw new Error(`HTTP ${response.status}`); 11 } 12 13 const data = await response.json(); 14 15 let _today = new Date(); 16 17 const date = new Date(_today); 18 const date_fin = date.toLocaleString('fi-FI'); 19 if (data.serviceOK) { 20 // notification_LoadingMapServices 21 let message = jQuery.i18n('notification_LoadingMapServices'); 22 console.log(date_fin + ': ' + message); 23 } else { 24 let error_message = jQuery.i18n('notification_problemsLoadingMapServices'); 25 loadErrors.push(error_message); 26 console.log(error_message); 27 let errorMessage = 28 '<div style="width:100%;display:flex;justify-content:center;flex-direction:column; align-content:center;">' + 29 '<div>' + 30 error_message + 31 '</div>' + 32 '</div>'; 33 infoWindow_showNotification(errorMessage, false, jQuery.i18n('notification_problemsLoadingEnvironment'), jQuery.i18n('common_close')); 34 // console.warn('â Vesi.fi karttapalvelu is unavailable'); 35 } 36 37 console.log(`Last checked: ${data.last_checked}`); 38 } catch (error) { 39 console.error('Status check failed:', error); 40 } 41} 42 43// // Run immediately 44// checkKarttapalveluStatus(); 45 46// // Then every 5 minutes 47// setInterval(checkKarttapalveluStatus, 5 * 60 * 1000);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.