Skip to content

Commit

Permalink
Merge pull request #145 from okauppinen/ortho-gfi-infinity
Browse files Browse the repository at this point in the history
Ortho GFI no values fix
  • Loading branch information
ZakarFin authored Sep 16, 2024
2 parents 5bb432e + b019e3b commit 3a97384
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion util/PTIOrtophotoTimeseriesGFIformatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export class PTIOrtophotoTimeseriesGFIformatter {
const photoYearAttr = layerAttributes.PTI_GFI_property || 'kuvausvuosi';
const label = Oskari.getLocalized(layerAttributes.PTI_GFI_label || 'Vuosi');
const years = geojson.features.map(feature => parseInt(feature.properties[photoYearAttr], 10));
return `<b>${label}:</b> ${Math.max(...years)}`;
const year = years.length ? Math.max(...years) : '-';
return `<b>${label}:</b> ${year}`;
} catch (err) {
Oskari.log('PTIOrtophotoTimeseriesGFIformatter').warn(`Couldn't format GFI data`, data);
}
Expand Down

0 comments on commit 3a97384

Please sign in to comment.