diff --git a/src/components/event/GeneralInformation.vue b/src/components/event/GeneralInformation.vue index c9f5cbe..99de8f0 100644 --- a/src/components/event/GeneralInformation.vue +++ b/src/components/event/GeneralInformation.vue @@ -63,7 +63,7 @@ this.items[8].value = data.processingMethod.long this.items[9].value = agency(data.agency) this.items[10].value = data.nearestCity.data.feltReportAnalysis ? - data.nearestCity.data.feltReportAnalysis.data.felt_reports_count : 0 + data.nearestCity.data.feltReportAnalysis.data.felt_reports_count : data.felt_reports_count } }, watch: { diff --git a/src/components/maps/GeneralInformation.vue b/src/components/maps/GeneralInformation.vue index b648a20..ebcbe8d 100644 --- a/src/components/maps/GeneralInformation.vue +++ b/src/components/maps/GeneralInformation.vue @@ -23,7 +23,7 @@ }, methods: { syncFeltReportData: function(event) { - if (this.event.nearestCity.data.feltReportAnalysis) { + if (this.event.nearestCity.data.feltReportAnalysis || this.event.felt_reports_count) { this.$http.get(apiSettings.endpointEventMeasuredIntensityAggregations(this.event.id)) .then(response => { this.addData(event.data.data, response.data.feltReports) diff --git a/src/components/maps/Settlements.vue b/src/components/maps/Settlements.vue index 0c3afa1..69110ef 100644 --- a/src/components/maps/Settlements.vue +++ b/src/components/maps/Settlements.vue @@ -63,7 +63,7 @@ let feltReportsData = [] try { - if (this.event.nearestCity.data.feltReportAnalysis) { + if (this.event.nearestCity.data.feltReportAnalysis || this.event.felt_reports_count) { const response = await this.$http.get(apiSettings.endpointEventMeasuredIntensityAggregations(this.event.id)) feltReportsData = response.data.feltReports } diff --git a/src/components/poll/FeltReportPoll.vue b/src/components/poll/FeltReportPoll.vue index f51b067..6132fb0 100644 --- a/src/components/poll/FeltReportPoll.vue +++ b/src/components/poll/FeltReportPoll.vue @@ -60,16 +60,20 @@ diff --git a/src/components/poll/mixins/geolocation.js b/src/components/poll/mixins/timezone.js similarity index 53% rename from src/components/poll/mixins/geolocation.js rename to src/components/poll/mixins/timezone.js index bdc9010..21984f6 100644 --- a/src/components/poll/mixins/geolocation.js +++ b/src/components/poll/mixins/timezone.js @@ -3,10 +3,6 @@ import ts from '@mapbox/timespace' export default { data() { return { - location: { - lat: null, - lon: null - }, timezoneOffset: 0, timezone: 'UTC' } @@ -29,32 +25,6 @@ export default { const time = ts.getFuzzyLocalTimeFromPoint(timestamp, point) this.timezoneOffset = time._d.getTimezoneOffset() this.timezone = this.formatTimezone(this.timezoneOffset) - }, - getCurrentLocation() { - let vm = this - window.navigator.geolocation.getCurrentPosition( - function(position) { - vm.location.lat = position.coords.latitude - vm.location.lon = position.coords.longitude - vm.getTimezone() - }, - function(error) { - const errorTypes = { - 1: 'PERMISSION_DENIED', - 2: 'POSITION_UNAVAILABLE', - 3: 'TIMEOUT' - } - console.error(error.message, {code: errorTypes[error.code]}) - } - ) - } - }, - mounted() { - if (window.navigator.geolocation) { - this.getCurrentLocation() - } - else { - console.warn('GeoLocation API is unavailable for your browser') } } }