diff --git a/lib/www/client/source/src/views/Map.vue b/lib/www/client/source/src/views/Map.vue index 46f29ea..8ab5faa 100644 --- a/lib/www/client/source/src/views/Map.vue +++ b/lib/www/client/source/src/views/Map.vue @@ -598,6 +598,14 @@ export default { computed: { + lineTStamp () { + return this.$store.state.line.timestamp; + }, + + sequenceTStamp () { + return this.$store.state.sequence.timestamp; + }, + sequenceData () { return this.sequenceDataElements?.map( el => el.data ); }, @@ -757,7 +765,7 @@ export default { return title; }, - ...mapGetters(['user', 'loading', 'serverEvent', 'lineName', 'serverEvent', 'labels']), + ...mapGetters(['user', 'loading', 'serverEvent', 'lineName', 'serverEvent', 'lines', 'plannedSequences', 'sequences', 'labels']), ...mapState({projectSchema: state => state.project.projectSchema}) }, @@ -773,6 +781,22 @@ export default { deep: true }, + lines () { + // Refresh map on change of preplot data + this.render(); + }, + + plannedSequences () { + // Refresh map on change of planned lines + this.render(); + }, + + sequences () { + // Refresh map on change of sequence data (raw / final) + this.sequenceDataTStamp = Date.now(); + this.render(); + }, + labels () { // Refresh the events layer on labels change if (this.layerSelection.includes("log")) { diff --git a/lib/www/client/source/src/views/MapLayersMixin.vue b/lib/www/client/source/src/views/MapLayersMixin.vue index 439c0e8..c1af670 100644 --- a/lib/www/client/source/src/views/MapLayersMixin.vue +++ b/lib/www/client/source/src/views/MapLayersMixin.vue @@ -234,7 +234,7 @@ export default { vesselTrackLinesLayer (options = {}) { return new LineLayer({ id: 'navl', - data: `/api/navdata`, + data: `/api/navdata?v=${Date.now()}`, // NOTE Not too sure about this lineWidthMinPixels: 2, getLineColor: (d) => d.properties.ntba ? [240, 248, 255, 200] : [85, 170, 255, 200], getSourcePosition: (obj, i) => i.index < i.data?.length ? [i.data[i.index]?.longitude, i.data[i.index]?.latitude] : null, @@ -297,7 +297,7 @@ export default { preplotSaillinesLinesLayer (options = {}) { return new GeoJsonLayer({ id: 'psll', - data: `/api/project/${this.$route.params.project}/gis/preplot/line?class=V`, + data: `/api/project/${this.$route.params.project}/gis/preplot/line?class=V&v=${this.lineTStamp?.valueOf()}`, lineWidthMinPixels: 1, getLineColor: (d) => d.properties.ntba ? [240, 248, 255, 200] : [85, 170, 255, 200], getLineWidth: 1, @@ -312,7 +312,7 @@ export default { preplotLinesLayer (options = {}) { return new GeoJsonLayer({ id: 'ppll', - data: `/api/project/${this.$route.params.project}/gis/preplot/line`, + data: `/api/project/${this.$route.params.project}/gis/preplot/line?v=${this.lineTStamp?.valueOf()}`, lineWidthMinPixels: 1, getLineColor: (d) => d.properties.ntba ? [240, 248, 255, 200] : [85, 170, 255, 200], getLineWidth: 1, @@ -345,7 +345,7 @@ export default { rawSequencesLinesLayer (options = {}) { return new GeoJsonLayer({ id: 'seqrl', - data: `/api/project/${this.$route.params.project}/gis/raw/line`, + data: `/api/project/${this.$route.params.project}/gis/raw/line?v=${this.sequenceTStamp?.valueOf()}`, lineWidthMinPixels: 1, getLineColor: (d) => d.properties.ntbp ? [0xe6, 0x51, 0x00, 200] : [0xff, 0x98, 0x00, 200], getLineWidth: 1, @@ -360,7 +360,7 @@ export default { finalSequencesLinesLayer (options = {}) { return new GeoJsonLayer({ id: 'seqfl', - data: `/api/project/${this.$route.params.project}/gis/final/line`, + data: `/api/project/${this.$route.params.project}/gis/final/line?v=${this.sequenceTStamp?.valueOf()}`, lineWidthMinPixels: 1, getLineColor: (d) => d.properties.pending ? [0xa7, 0xff, 0xab, 200] : [0x00, 0x96, 0x88, 200], getLineWidth: 1,