diff --git a/components/Report.vue b/components/Report.vue index 17cba34..f85a280 100644 --- a/components/Report.vue +++ b/components/Report.vue @@ -171,7 +171,7 @@ Hydrology charts with multiple variables, models, and scenarios, grouped decadally and by month of the year. -
  • +
  • Permafrost with specific visualizations depending on the presence or absence of permafrost
  • @@ -236,7 +236,7 @@ Elevation: {{ httpErrors[elevationHttpError] }} -
  • +
  • Permafrost: {{ httpErrors[permafrostHttpError] }}
  • @@ -273,7 +273,7 @@
    @@ -481,7 +481,7 @@ export default { beetleHttpError: 'beetle/httpError', hydrologyHttpError: 'hydrology/httpError', isPointLocation: 'place/isPointLocation', - showPermafrost: 'permafrost/showPermafrost', + forceShowPermafrost: 'permafrost/forceShowPermafrost', }), }, // This component initiates the data fetching so that diff --git a/store/permafrost.js b/store/permafrost.js index 702077f..3dde861 100644 --- a/store/permafrost.js +++ b/store/permafrost.js @@ -119,30 +119,24 @@ export const getters = { return !permafrosttopValues.every(value => value === 0) }, - showPermafrost: (state, getters, rootState, rootGetters) => { - let communityId = rootGetters['place/communityId'] - let latLng = rootGetters['place/latLng'] + forceShowPermafrost: (state, getters, rootState, rootGetters) => { let areaId = rootGetters['place/areaId'] - // We do not have permafrost data for Canada, so don't show permafrost - // section for Canadian communities, Canadian protected areas, First Nation - // Traditional Territories, or lat/lon points that are approximately - // Canadian. - if (communityId && !communityId.startsWith('AK')) { - return false - } else if ( - areaId && - (areaId.startsWith('BCPA') || + // Always show permafrost section for area reports unless the areas are + // Canadian. I.e., do not show permafrost for these area code prefixes: + // BCPA: British Columbia Protected Areas + // FNTT: First Nation Traditional Territories + // YTPA: Yukon Protected Areas + if (areaId) { + if ( + areaId.startsWith('BCPA') || areaId.startsWith('FNTT') || - areaId.startsWith('YTPA')) - ) { - return false - } else if (latLng && latLng[0] > 60 && latLng[1] > -141.1) { - return false - } else if (latLng && latLng[0] < 60 && latLng[1] > -129.9) { - return false - } else { - return true + areaId.startsWith('YTPA') + ) { + return false + } else { + return true + } } }, }