@abi-software/flatmapvuer 0.6.1-annotator.0 → 0.6.1-demo-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -4
- package/cypress.config.js +24 -0
- package/dist/flatmapvuer.js +28470 -28436
- package/dist/flatmapvuer.umd.cjs +183 -170
- package/dist/style.css +1 -1
- package/package.json +23 -14
- package/reporter-config.json +10 -0
- package/src/App.vue +3 -11
- package/src/components/AnnotationTool.vue +21 -13
- package/src/components/ExternalResourceCard.vue +1 -0
- package/src/components/FlatmapVuer.vue +791 -328
- package/src/components/MultiFlatmapVuer.vue +163 -45
- package/src/components/ProvenancePopup.vue +41 -9
- package/src/components/RelevanceDialog.vue +102 -0
- package/src/components/Tooltip.vue +2 -2
- package/src/components.d.ts +1 -1
- package/src/icons/yellowstar.js +1 -1
- package/src/services/flatmapQueries.js +3 -23
- package/vite.config.js +4 -1
- package/vuese-generator.js +65 -0
|
@@ -151,11 +151,10 @@
|
|
|
151
151
|
<template #reference>
|
|
152
152
|
<map-svg-icon
|
|
153
153
|
icon="connection"
|
|
154
|
-
class="icon-button
|
|
155
|
-
@click="
|
|
154
|
+
class="icon-button drawRelevance inactive"
|
|
155
|
+
@click="relevanceDialogPopup"
|
|
156
156
|
@mouseover="showToolitip(10)"
|
|
157
157
|
@mouseout="hideToolitip(10)"
|
|
158
|
-
v-show="hasRelevance && !inDrawing"
|
|
159
158
|
/>
|
|
160
159
|
</template>
|
|
161
160
|
</el-popover>
|
|
@@ -167,13 +166,13 @@
|
|
|
167
166
|
width="80"
|
|
168
167
|
popper-class="flatmap-popper"
|
|
169
168
|
:visible="hoverVisibilities[11].value"
|
|
170
|
-
v-if="
|
|
169
|
+
v-if="drawnType !== 'LineString' && drawnType !== 'Polygon'"
|
|
171
170
|
>
|
|
172
171
|
<template #reference>
|
|
173
172
|
<map-svg-icon
|
|
174
173
|
icon="drawPoint"
|
|
175
174
|
class="icon-button drawPoint"
|
|
176
|
-
@click="
|
|
175
|
+
@click="drawingEvent('Point')"
|
|
177
176
|
@mouseover="showToolitip(11)"
|
|
178
177
|
@mouseout="hideToolitip(11)"
|
|
179
178
|
/>
|
|
@@ -187,13 +186,13 @@
|
|
|
187
186
|
width="80"
|
|
188
187
|
popper-class="flatmap-popper"
|
|
189
188
|
:visible="hoverVisibilities[12].value"
|
|
190
|
-
v-if="
|
|
189
|
+
v-if="drawnType !== 'Point' && drawnType !== 'Polygon'"
|
|
191
190
|
>
|
|
192
191
|
<template #reference>
|
|
193
192
|
<map-svg-icon
|
|
194
193
|
icon="drawLine"
|
|
195
194
|
class="icon-button drawLineString"
|
|
196
|
-
@click="
|
|
195
|
+
@click="drawingEvent('LineString')"
|
|
197
196
|
@mouseover="showToolitip(12)"
|
|
198
197
|
@mouseout="hideToolitip(12)"
|
|
199
198
|
/>
|
|
@@ -207,13 +206,13 @@
|
|
|
207
206
|
width="80"
|
|
208
207
|
popper-class="flatmap-popper"
|
|
209
208
|
:visible="hoverVisibilities[13].value"
|
|
210
|
-
v-if="
|
|
209
|
+
v-if="drawnType !== 'Point' && drawnType !== 'LineString'"
|
|
211
210
|
>
|
|
212
211
|
<template #reference>
|
|
213
212
|
<map-svg-icon
|
|
214
213
|
icon="drawPolygon"
|
|
215
214
|
class="icon-button drawPolygon"
|
|
216
|
-
@click="
|
|
215
|
+
@click="drawingEvent('Polygon')"
|
|
217
216
|
@mouseover="showToolitip(13)"
|
|
218
217
|
@mouseout="hideToolitip(13)"
|
|
219
218
|
/>
|
|
@@ -231,8 +230,8 @@
|
|
|
231
230
|
<template #reference>
|
|
232
231
|
<map-svg-icon
|
|
233
232
|
icon="drawTrash"
|
|
234
|
-
class="icon-button
|
|
235
|
-
@click="
|
|
233
|
+
class="icon-button drawDelete"
|
|
234
|
+
@click="drawingEvent('Delete')"
|
|
236
235
|
@mouseover="showToolitip(14)"
|
|
237
236
|
@mouseout="hideToolitip(14)"
|
|
238
237
|
/>
|
|
@@ -250,8 +249,8 @@
|
|
|
250
249
|
<template #reference>
|
|
251
250
|
<map-svg-icon
|
|
252
251
|
icon="comment"
|
|
253
|
-
class="icon-button
|
|
254
|
-
@click="
|
|
252
|
+
class="icon-button drawEdit"
|
|
253
|
+
@click="drawingEvent('Edit')"
|
|
255
254
|
@mouseover="showToolitip(15)"
|
|
256
255
|
@mouseout="hideToolitip(15)"
|
|
257
256
|
/>
|
|
@@ -342,7 +341,7 @@
|
|
|
342
341
|
class="pathway-container"
|
|
343
342
|
:class="{ open: drawerOpen, close: !drawerOpen }"
|
|
344
343
|
:style="{ 'max-height': pathwaysMaxHeight + 'px' }"
|
|
345
|
-
|
|
344
|
+
|
|
346
345
|
v-popover:checkBoxPopover
|
|
347
346
|
>
|
|
348
347
|
<svg-legends v-if="!isFC" class="svg-legends-container" />
|
|
@@ -473,7 +472,14 @@
|
|
|
473
472
|
virtual-triggering
|
|
474
473
|
>
|
|
475
474
|
<el-row v-for="item in openMapOptions" :key="item.key">
|
|
476
|
-
<el-button type="primary" plain
|
|
475
|
+
<el-button type="primary" plain
|
|
476
|
+
@click="/**
|
|
477
|
+
* This event is emitted when the user chooses a different map option
|
|
478
|
+
* from ``openMapOptions`` props.
|
|
479
|
+
* @arg mapOption.key
|
|
480
|
+
* */
|
|
481
|
+
$emit('open-map', item.key)"
|
|
482
|
+
>
|
|
477
483
|
{{ item.display }}
|
|
478
484
|
</el-button>
|
|
479
485
|
</el-row>
|
|
@@ -485,7 +491,7 @@
|
|
|
485
491
|
width="200"
|
|
486
492
|
:teleported="false"
|
|
487
493
|
trigger="click"
|
|
488
|
-
popper-class="background-popper"
|
|
494
|
+
popper-class="background-popper h-auto"
|
|
489
495
|
virtual-triggering
|
|
490
496
|
>
|
|
491
497
|
<div>
|
|
@@ -499,8 +505,8 @@
|
|
|
499
505
|
popper-class="flatmap_dropdown"
|
|
500
506
|
>
|
|
501
507
|
<el-option
|
|
502
|
-
v-for="item in viewingModes"
|
|
503
|
-
:key="item"
|
|
508
|
+
v-for="(item, i) in viewingModes"
|
|
509
|
+
:key="item + i"
|
|
504
510
|
:label="item"
|
|
505
511
|
:value="item"
|
|
506
512
|
>
|
|
@@ -511,18 +517,18 @@
|
|
|
511
517
|
</el-select>
|
|
512
518
|
</el-row>
|
|
513
519
|
<template v-if="viewingMode === 'Annotation' && userInformation">
|
|
514
|
-
<el-row class="backgroundText">
|
|
520
|
+
<el-row class="backgroundText">Drawn By*</el-row>
|
|
515
521
|
<el-row class="backgroundControl">
|
|
516
522
|
<el-select
|
|
517
523
|
:teleported="false"
|
|
518
|
-
v-model="
|
|
524
|
+
v-model="drawnType"
|
|
519
525
|
placeholder="Select"
|
|
520
526
|
class="select-box"
|
|
521
527
|
popper-class="flatmap_dropdown"
|
|
522
|
-
@change="
|
|
528
|
+
@change="setDrawnType"
|
|
523
529
|
>
|
|
524
530
|
<el-option
|
|
525
|
-
v-for="item in
|
|
531
|
+
v-for="item in drawnTypes"
|
|
526
532
|
:key="item"
|
|
527
533
|
:label="item"
|
|
528
534
|
:value="item"
|
|
@@ -533,18 +539,18 @@
|
|
|
533
539
|
</el-option>
|
|
534
540
|
</el-select>
|
|
535
541
|
</el-row>
|
|
536
|
-
<el-row class="backgroundText">
|
|
542
|
+
<el-row class="backgroundText">Annotated By*</el-row>
|
|
537
543
|
<el-row class="backgroundControl">
|
|
538
544
|
<el-select
|
|
539
545
|
:teleported="false"
|
|
540
|
-
v-model="
|
|
546
|
+
v-model="annotatedType"
|
|
541
547
|
placeholder="Select"
|
|
542
548
|
class="select-box"
|
|
543
549
|
popper-class="flatmap_dropdown"
|
|
544
|
-
@change="
|
|
550
|
+
@change="setAnnotatedType"
|
|
545
551
|
>
|
|
546
552
|
<el-option
|
|
547
|
-
v-for="item in
|
|
553
|
+
v-for="item in annotatedTypes"
|
|
548
554
|
:key="item"
|
|
549
555
|
:label="item"
|
|
550
556
|
:value="item"
|
|
@@ -556,13 +562,13 @@
|
|
|
556
562
|
</el-select>
|
|
557
563
|
</el-row>
|
|
558
564
|
</template>
|
|
559
|
-
<el-row class="backgroundSpacer"></el-row>
|
|
560
|
-
<el-row class="backgroundText">
|
|
561
|
-
<el-row class="backgroundControl">
|
|
565
|
+
<el-row class="backgroundSpacer" v-if="displayFlightPathOption"></el-row>
|
|
566
|
+
<el-row class="backgroundText" v-if="displayFlightPathOption">Flight path display</el-row>
|
|
567
|
+
<el-row class="backgroundControl" v-if="displayFlightPathOption">
|
|
562
568
|
<el-radio-group
|
|
563
|
-
v-model="
|
|
569
|
+
v-model="flightPath3DRadio"
|
|
564
570
|
class="flatmap-radio"
|
|
565
|
-
@change="
|
|
571
|
+
@change="setFlightPath3D"
|
|
566
572
|
>
|
|
567
573
|
<el-radio :label="false">2D</el-radio>
|
|
568
574
|
<el-radio :label="true">3D</el-radio>
|
|
@@ -663,53 +669,18 @@
|
|
|
663
669
|
:annotationDisplay="viewingMode === 'Annotation'"
|
|
664
670
|
@annotation="commitAnnotationEvent"
|
|
665
671
|
/>
|
|
666
|
-
<
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
:
|
|
670
|
-
:
|
|
671
|
-
:
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
</template>
|
|
679
|
-
<template #header v-else>
|
|
680
|
-
<el-button type="primary" plain @click="displayRelevanceDialog(false)">
|
|
681
|
-
Close
|
|
682
|
-
</el-button>
|
|
683
|
-
</template>
|
|
684
|
-
<el-row v-if="inDrawing">
|
|
685
|
-
<el-col :span="13">
|
|
686
|
-
<el-button type="primary" plain @click="confirmDrawnFeature">
|
|
687
|
-
Confirm
|
|
688
|
-
</el-button>
|
|
689
|
-
</el-col>
|
|
690
|
-
<el-col :span="11">
|
|
691
|
-
<el-button type="primary" plain @click="cancelDrawnFeature">
|
|
692
|
-
Cancel
|
|
693
|
-
</el-button>
|
|
694
|
-
</el-col>
|
|
695
|
-
</el-row>
|
|
696
|
-
<el-row v-if="hasRelevance">
|
|
697
|
-
<el-col :span="20">
|
|
698
|
-
<b><span>Related Features</span></b>
|
|
699
|
-
</el-col>
|
|
700
|
-
<el-col :span="4">
|
|
701
|
-
<el-icon><el-icon-circle-close @click="closePopup()"/></el-icon>
|
|
702
|
-
</el-col>
|
|
703
|
-
<el-card
|
|
704
|
-
shadow="hover"
|
|
705
|
-
v-for="(value, key) in relevanceEntry"
|
|
706
|
-
:key="key"
|
|
707
|
-
@click="displayRelevanceTooltip(value)"
|
|
708
|
-
>
|
|
709
|
-
<span>{{ key }}</span>
|
|
710
|
-
</el-card>
|
|
711
|
-
</el-row>
|
|
712
|
-
</el-dialog>
|
|
672
|
+
<RelevanceDialog
|
|
673
|
+
class="relevance-dialog"
|
|
674
|
+
v-show="relevanceDisplay"
|
|
675
|
+
:entry="relevanceEntry"
|
|
676
|
+
:drawing="inDrawing"
|
|
677
|
+
:relevance="relevance"
|
|
678
|
+
@display="relevanceDialogPopup"
|
|
679
|
+
@confirm="confirmDrawnFeature"
|
|
680
|
+
@cancel="cancelDrawnFeature"
|
|
681
|
+
@popup="closePopup"
|
|
682
|
+
@tooltip="checkAndCreatePopups"
|
|
683
|
+
/>
|
|
713
684
|
</div>
|
|
714
685
|
</div>
|
|
715
686
|
</template>
|
|
@@ -721,7 +692,6 @@ import {
|
|
|
721
692
|
WarningFilled as ElIconWarningFilled,
|
|
722
693
|
ArrowDown as ElIconArrowDown,
|
|
723
694
|
ArrowLeft as ElIconArrowLeft,
|
|
724
|
-
CircleClose as ElIconCircleClose,
|
|
725
695
|
} from '@element-plus/icons-vue'
|
|
726
696
|
import Tooltip from './Tooltip.vue'
|
|
727
697
|
import SelectionsGroup from './SelectionsGroup.vue'
|
|
@@ -746,14 +716,62 @@ import {
|
|
|
746
716
|
} from '../services/flatmapQueries.js'
|
|
747
717
|
import yellowstar from '../icons/yellowstar'
|
|
748
718
|
import ResizeSensor from 'css-element-queries/src/ResizeSensor'
|
|
749
|
-
import * as flatmap from '
|
|
719
|
+
import * as flatmap from '@abi-software/flatmap-viewer'
|
|
750
720
|
import { AnnotationService } from '@abi-software/sparc-annotation'
|
|
721
|
+
import RelevanceDialog from './RelevanceDialog.vue'
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* @param scopeElement Draggable scope area (Optional)
|
|
725
|
+
* @param dragElement Draggable element
|
|
726
|
+
*/
|
|
727
|
+
const draggable = (scopeElement, dragElement) => {
|
|
728
|
+
let startX, startY, clickX, clickY, posX, posY
|
|
729
|
+
// reset position in case previous pupped up dialog is dragged
|
|
730
|
+
dragElement.style.left = ''
|
|
731
|
+
dragElement.style.top = ''
|
|
732
|
+
// const scopeRect = scopeElement.getBoundingClientRect()
|
|
733
|
+
// const dragRect = dragElement.getBoundingClientRect()
|
|
734
|
+
|
|
735
|
+
dragElement.addEventListener('mousedown', (e) => {
|
|
736
|
+
e.preventDefault();
|
|
737
|
+
startX = dragElement.offsetLeft
|
|
738
|
+
startY = dragElement.offsetTop
|
|
739
|
+
clickX = e.clientX
|
|
740
|
+
clickY = e.clientY
|
|
741
|
+
|
|
742
|
+
dragElement.addEventListener('mousemove', drag, false);
|
|
743
|
+
document.addEventListener('mouseup', () => {
|
|
744
|
+
dragElement.removeEventListener('mousemove', drag, false);
|
|
745
|
+
}, false);
|
|
746
|
+
}, false);
|
|
747
|
+
|
|
748
|
+
function drag(e) {
|
|
749
|
+
e.preventDefault();
|
|
750
|
+
posX = startX - (clickX - e.clientX)
|
|
751
|
+
posY = startY - (clickY - e.clientY)
|
|
752
|
+
// if (
|
|
753
|
+
// (posX > scopeRect.left && ((posX + dragRect.width) < scopeRect.right)) &&
|
|
754
|
+
// (posY > scopeRect.top && ((posY + dragRect.height) < scopeRect.bottom))
|
|
755
|
+
// ) {
|
|
756
|
+
dragElement.style.left = `${posX}px`;
|
|
757
|
+
dragElement.style.top = `${posY}px`;
|
|
758
|
+
// } else {
|
|
759
|
+
// if (posX <= scopeRect.left) {
|
|
760
|
+
// dragElement.style.left = '0px';
|
|
761
|
+
// } else if (posX + dragRect.width >= scopeRect.right) {
|
|
762
|
+
// dragElement.style.left = `${scopeRect.right - dragRect.width}px`;
|
|
763
|
+
// }
|
|
764
|
+
// if (posY <= scopeRect.top) {
|
|
765
|
+
// dragElement.style.top = '0px';
|
|
766
|
+
// } else if (posY + dragRect.height >= scopeRect.bottom) {
|
|
767
|
+
// dragElement.style.top = `${scopeRect.bottom - dragRect.height}px`;
|
|
768
|
+
// }
|
|
769
|
+
// }
|
|
770
|
+
}
|
|
771
|
+
}
|
|
751
772
|
|
|
752
773
|
const centroid = (geometry) => {
|
|
753
|
-
let featureGeometry = {
|
|
754
|
-
lng: 0,
|
|
755
|
-
lat: 0,
|
|
756
|
-
}
|
|
774
|
+
let featureGeometry = { lng: 0, lat: 0, }
|
|
757
775
|
let coordinates
|
|
758
776
|
if (geometry.type === "Polygon") {
|
|
759
777
|
coordinates = geometry.coordinates[0]
|
|
@@ -834,6 +852,9 @@ const createUnfilledTooltipData = function () {
|
|
|
834
852
|
}
|
|
835
853
|
}
|
|
836
854
|
|
|
855
|
+
/**
|
|
856
|
+
* A vue component of the flatmap viewer.
|
|
857
|
+
*/
|
|
837
858
|
export default {
|
|
838
859
|
name: 'FlatmapVuer',
|
|
839
860
|
components: {
|
|
@@ -868,111 +889,73 @@ export default {
|
|
|
868
889
|
return { annotator }
|
|
869
890
|
},
|
|
870
891
|
methods: {
|
|
871
|
-
displayRelevanceTooltip: function (value) {
|
|
872
|
-
if (this.mapImp) {
|
|
873
|
-
this.checkAndCreatePopups(value)
|
|
874
|
-
}
|
|
875
|
-
},
|
|
876
892
|
// This should be called when create is confirmed or cancelled
|
|
877
|
-
|
|
893
|
+
initialiseDrawing: function () {
|
|
878
894
|
this.inDrawing = false
|
|
879
|
-
this.
|
|
880
|
-
this.relevanceEntry = {}
|
|
895
|
+
this.initialiseDialog()
|
|
881
896
|
this.activeDrawTool = undefined
|
|
882
897
|
this.createdEvent = undefined
|
|
883
|
-
this.setActiveDrawIcon()
|
|
884
898
|
},
|
|
885
899
|
cancelDrawnFeature: function () {
|
|
886
900
|
if (this.createdEvent) {
|
|
887
|
-
// For 'created' callback
|
|
888
901
|
this.closePopup()
|
|
889
902
|
this.annotationEntry = {
|
|
890
903
|
...this.createdEvent.feature,
|
|
891
904
|
resourceId: this.serverUUID,
|
|
892
905
|
}
|
|
893
906
|
this.rollbackAnnotationEvent()
|
|
894
|
-
this.
|
|
907
|
+
this.initialiseDrawing()
|
|
895
908
|
}
|
|
896
909
|
},
|
|
897
910
|
confirmDrawnFeature: function () {
|
|
898
911
|
if (this.createdEvent) {
|
|
899
912
|
this.checkAndCreatePopups(this.createdEvent)
|
|
900
913
|
// Add relevance if exist to annotationEntry
|
|
901
|
-
// Relevance will only be added in creating
|
|
902
|
-
// And will not be updated if move drawn
|
|
914
|
+
// Relevance will only be added in creating new drawn feature annotation
|
|
915
|
+
// And will not be updated if move drawn features
|
|
903
916
|
if (Object.keys(this.relevanceEntry).length > 0) {
|
|
904
917
|
this.annotationEntry.feature.relevance = this.relevanceEntry
|
|
905
918
|
}
|
|
906
|
-
this.
|
|
919
|
+
this.initialiseDrawing()
|
|
907
920
|
}
|
|
908
921
|
},
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
if
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
// Reset drawn event
|
|
920
|
-
this.drawnEvent()
|
|
921
|
-
} else if (this.createdEvent || Object.keys(this.relevanceEntry).length > 0) {
|
|
922
|
-
this.relevanceDisplay = display
|
|
923
|
-
if (!display && this.activeDrawMode === 'Delete') this.relevanceEntry = {}
|
|
924
|
-
}
|
|
925
|
-
},
|
|
926
|
-
setActiveDrawIcon: function () {
|
|
927
|
-
let mclass
|
|
928
|
-
if (document.querySelector('.toolSelected')) {
|
|
929
|
-
this.drawingTypes.map((t) => {
|
|
930
|
-
if (t !== 'All' && t !== 'None') {
|
|
931
|
-
document.querySelector(`.draw${t}`).classList.remove('toolSelected');
|
|
932
|
-
}
|
|
933
|
-
})
|
|
934
|
-
this.drawModes.map((m) => {
|
|
935
|
-
if (m === 'Delete') mclass = '.drawTrash'
|
|
936
|
-
else if (m === 'Edit') mclass = '.comment'
|
|
937
|
-
document.querySelector(mclass).classList.remove('toolSelected');
|
|
938
|
-
})
|
|
939
|
-
}
|
|
940
|
-
if (this.activeDrawTool) {
|
|
941
|
-
document.querySelector(`.draw${this.activeDrawTool}`).classList.add('toolSelected');
|
|
942
|
-
} else if (this.activeDrawMode) {
|
|
943
|
-
if (this.activeDrawMode === 'Delete') mclass = '.drawTrash'
|
|
944
|
-
else if (this.activeDrawMode === 'Edit') mclass = '.comment'
|
|
945
|
-
document.querySelector(mclass).classList.add('toolSelected');
|
|
922
|
+
initialiseDialog: function () {
|
|
923
|
+
this.relevanceDisplay = false
|
|
924
|
+
this.relevanceEntry = {}
|
|
925
|
+
},
|
|
926
|
+
relevanceDialogPopup: function () {
|
|
927
|
+
const inactive = this.$el.querySelector('.drawRelevance').classList.contains('inactive')
|
|
928
|
+
// disable click popup if icon inactive or in drawing
|
|
929
|
+
if (!inactive && !this.inDrawing) {
|
|
930
|
+
this.closePopup()
|
|
931
|
+
this.relevanceDisplay = !this.relevanceDisplay
|
|
946
932
|
}
|
|
947
933
|
},
|
|
948
|
-
|
|
934
|
+
drawingEvent: function (type) {
|
|
949
935
|
this.closePopup()
|
|
950
|
-
if
|
|
951
|
-
|
|
952
|
-
this.activeDrawMode = undefined
|
|
953
|
-
this.inDrawing = false
|
|
954
|
-
} else if (this.drawingTypes.includes(type)) {
|
|
955
|
-
if (this.activeDrawMode) {
|
|
956
|
-
document.querySelector('.mapbox-gl-draw_trash').click()
|
|
957
|
-
this.activeDrawMode = undefined
|
|
958
|
-
}
|
|
936
|
+
// disable mode icon click if any tool is active
|
|
937
|
+
if (this.drawnTypes.includes(type) && !this.activeDrawMode && !this.relevanceDisplay) {
|
|
959
938
|
if (type === 'Point') {
|
|
960
|
-
|
|
961
|
-
this.
|
|
939
|
+
const point = this.$el.querySelector('.mapbox-gl-draw_point')
|
|
940
|
+
this.$el.querySelector('.mapbox-gl-draw_point').click()
|
|
941
|
+
this.activeDrawTool = point.classList.contains('active') ? 'Point' : undefined
|
|
962
942
|
} else if (type === 'LineString') {
|
|
963
|
-
|
|
964
|
-
this.
|
|
943
|
+
const line = this.$el.querySelector('.mapbox-gl-draw_line')
|
|
944
|
+
this.$el.querySelector('.mapbox-gl-draw_line').click()
|
|
945
|
+
this.activeDrawTool = line.classList.contains('active') ? 'LineString' : undefined
|
|
965
946
|
} else if (type === 'Polygon') {
|
|
966
|
-
|
|
967
|
-
this.
|
|
968
|
-
|
|
969
|
-
} else if (this.drawModes.includes(type)) {
|
|
970
|
-
if (this.activeDrawTool) {
|
|
971
|
-
document.querySelector('.mapbox-gl-draw_trash').click()
|
|
972
|
-
this.activeDrawTool = undefined
|
|
947
|
+
const polygon = this.$el.querySelector('.mapbox-gl-draw_polygon')
|
|
948
|
+
this.$el.querySelector('.mapbox-gl-draw_polygon').click()
|
|
949
|
+
this.activeDrawTool = polygon.classList.contains('active') ? 'Polygon' : undefined
|
|
973
950
|
}
|
|
951
|
+
// disable tool icon click if any mode is on
|
|
952
|
+
} else if (this.drawModes.includes(type) && !this.activeDrawTool) {
|
|
974
953
|
if (type === 'Delete') {
|
|
975
|
-
if (
|
|
954
|
+
if (
|
|
955
|
+
this.currentDrawnFeature &&
|
|
956
|
+
// For either no mode is on or edit is on
|
|
957
|
+
(!this.activeDrawMode || this.activeDrawMode === 'Edit')
|
|
958
|
+
) {
|
|
976
959
|
// Force simple_select a feature for delete event
|
|
977
960
|
this.doubleClickedFeature = false
|
|
978
961
|
this.changeAnnotationDrawMode({
|
|
@@ -982,11 +965,14 @@ export default {
|
|
|
982
965
|
this.trashAnnotationFeature()
|
|
983
966
|
}
|
|
984
967
|
this.activeDrawMode = this.activeDrawMode === 'Delete' ? undefined : 'Delete'
|
|
968
|
+
// clear currentDrawnFeature when quit delete mode
|
|
969
|
+
if (!this.activeDrawMode) {
|
|
970
|
+
this.currentDrawnFeature = undefined
|
|
971
|
+
}
|
|
985
972
|
} else if (type === 'Edit') {
|
|
986
973
|
this.activeDrawMode = this.activeDrawMode === 'Edit' ? undefined : 'Edit'
|
|
987
974
|
}
|
|
988
975
|
}
|
|
989
|
-
this.setActiveDrawIcon()
|
|
990
976
|
},
|
|
991
977
|
changeAnnotationDrawMode: function (mode) {
|
|
992
978
|
if (this.mapImp) {
|
|
@@ -1009,11 +995,12 @@ export default {
|
|
|
1009
995
|
}
|
|
1010
996
|
},
|
|
1011
997
|
rollbackAnnotationEvent: function () {
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
998
|
+
// For 'updated' and 'deleted' callback
|
|
999
|
+
if (
|
|
1000
|
+
this.mapImp &&
|
|
1001
|
+
this.drawnAnnotationEvent.includes(this.annotationEntry.type)
|
|
1002
|
+
) {
|
|
1003
|
+
this.mapImp.rollbackAnnotationEvent(this.annotationEntry)
|
|
1017
1004
|
}
|
|
1018
1005
|
},
|
|
1019
1006
|
commitAnnotationEvent: function (annotation) {
|
|
@@ -1024,8 +1011,13 @@ export default {
|
|
|
1024
1011
|
annotation
|
|
1025
1012
|
) {
|
|
1026
1013
|
this.annotationSubmitted = true
|
|
1027
|
-
if (this.annotationEntry.type === 'deleted') this.closePopup()
|
|
1028
1014
|
this.mapImp.commitAnnotationEvent(this.annotationEntry)
|
|
1015
|
+
if (this.annotationEntry.type === 'deleted') {
|
|
1016
|
+
this.closePopup()
|
|
1017
|
+
} else {
|
|
1018
|
+
// Use to update 'this.drawnAnnotationFeatures' when created or updated
|
|
1019
|
+
this.addAnnotationFeature()
|
|
1020
|
+
}
|
|
1029
1021
|
}
|
|
1030
1022
|
},
|
|
1031
1023
|
setFeatureAnnotated: function () {
|
|
@@ -1043,39 +1035,42 @@ export default {
|
|
|
1043
1035
|
},
|
|
1044
1036
|
addAnnotationFeature: function () {
|
|
1045
1037
|
if (this.mapImp) {
|
|
1046
|
-
this.clearAnnotationFeature()
|
|
1047
|
-
if (this.
|
|
1038
|
+
if (!this.annotationSubmitted) this.clearAnnotationFeature()
|
|
1039
|
+
if (this.drawnType !== 'None') {
|
|
1048
1040
|
this.annotator.drawnFeatures(this.serverUUID)
|
|
1049
1041
|
.then((drawnFeatures) => {
|
|
1050
1042
|
// Use to switch the displayed feature type
|
|
1051
|
-
if (this.
|
|
1043
|
+
if (this.drawnType !== 'All tools') {
|
|
1052
1044
|
drawnFeatures = drawnFeatures.filter((feature) => {
|
|
1053
|
-
return feature.geometry.type === this.
|
|
1045
|
+
return feature.geometry.type === this.drawnType
|
|
1054
1046
|
})
|
|
1055
1047
|
}
|
|
1056
1048
|
this.drawnAnnotationFeatures = drawnFeatures
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
.
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
(
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1049
|
+
// No need to call 'addAnnotationFeature' when a new feature created
|
|
1050
|
+
if (!this.annotationSubmitted) {
|
|
1051
|
+
for (const feature of drawnFeatures) {
|
|
1052
|
+
if (this.annotatedType !== 'Everyone') {
|
|
1053
|
+
this.annotator
|
|
1054
|
+
.itemAnnotations(this.serverUUID, feature.id)
|
|
1055
|
+
.then((value) => {
|
|
1056
|
+
let participated = value.filter((v) => {
|
|
1057
|
+
return (
|
|
1058
|
+
v.creator.name === this.userInformation.name &&
|
|
1059
|
+
v.creator.email === this.userInformation.email
|
|
1060
|
+
)
|
|
1061
|
+
}).length > 0
|
|
1062
|
+
if (
|
|
1063
|
+
(this.annotatedType === 'Me' && participated) ||
|
|
1064
|
+
(this.annotatedType === 'Others' && !participated)
|
|
1065
|
+
) {
|
|
1066
|
+
this.mapImp.addAnnotationFeature(feature)
|
|
1067
|
+
}
|
|
1068
|
+
})
|
|
1069
|
+
.catch((reason) => {
|
|
1070
|
+
console.log(reason) // Error!
|
|
1071
|
+
})
|
|
1072
|
+
} else this.mapImp.addAnnotationFeature(feature)
|
|
1073
|
+
}
|
|
1079
1074
|
}
|
|
1080
1075
|
})
|
|
1081
1076
|
.catch((reason) => {
|
|
@@ -1089,27 +1084,36 @@ export default {
|
|
|
1089
1084
|
// Control the show/hide of the drawn annotations
|
|
1090
1085
|
this.mapImp.showAnnotator(flag)
|
|
1091
1086
|
// Hide default toolbar, we will use customised SVG icons instead
|
|
1092
|
-
|
|
1087
|
+
this.$el.querySelector('.maplibregl-ctrl-group').style.display = 'none'
|
|
1093
1088
|
}
|
|
1094
1089
|
},
|
|
1095
|
-
|
|
1096
|
-
this.
|
|
1090
|
+
setDrawnType: function (flag) {
|
|
1091
|
+
this.drawnType = flag
|
|
1097
1092
|
if (this.mapImp) {
|
|
1098
1093
|
this.addAnnotationFeature()
|
|
1099
1094
|
}
|
|
1100
1095
|
},
|
|
1101
|
-
|
|
1102
|
-
this.
|
|
1096
|
+
setAnnotatedType: function (flag) {
|
|
1097
|
+
this.annotatedType = flag
|
|
1103
1098
|
if (this.mapImp) {
|
|
1104
1099
|
this.addAnnotationFeature()
|
|
1105
1100
|
}
|
|
1106
1101
|
},
|
|
1107
|
-
|
|
1108
|
-
|
|
1102
|
+
/**
|
|
1103
|
+
* @vuese
|
|
1104
|
+
* Function to switch from 2D to 3D
|
|
1105
|
+
* @arg flag
|
|
1106
|
+
*/
|
|
1107
|
+
setFlightPath3D: function (flag) {
|
|
1108
|
+
this.flightPath3DRadio = flag
|
|
1109
1109
|
if (this.mapImp) {
|
|
1110
1110
|
this.mapImp.enable3dPaths(flag)
|
|
1111
1111
|
}
|
|
1112
1112
|
},
|
|
1113
|
+
/**
|
|
1114
|
+
* @vuese
|
|
1115
|
+
* Function to view the latest map (example when you are on legacy map).
|
|
1116
|
+
*/
|
|
1113
1117
|
viewLatestMap: function () {
|
|
1114
1118
|
let biologicalSex = this.biologicalSex ? this.biologicalSex : undefined
|
|
1115
1119
|
//Human requires special handling
|
|
@@ -1121,14 +1125,28 @@ export default {
|
|
|
1121
1125
|
biologicalSex,
|
|
1122
1126
|
viewport: this.mapImp.getState(),
|
|
1123
1127
|
}
|
|
1128
|
+
/**
|
|
1129
|
+
* The event emitted by ``viewLatestMap`` method.
|
|
1130
|
+
*/
|
|
1124
1131
|
this.$emit('view-latest-map', state)
|
|
1125
1132
|
},
|
|
1133
|
+
/**
|
|
1134
|
+
* @vuese
|
|
1135
|
+
* Function to change the background colour of the map
|
|
1136
|
+
* by providing the ``colour``.
|
|
1137
|
+
* @arg colour
|
|
1138
|
+
*/
|
|
1126
1139
|
backgroundChangeCallback: function (colour) {
|
|
1127
1140
|
this.currentBackground = colour
|
|
1128
1141
|
if (this.mapImp) {
|
|
1129
1142
|
this.mapImp.setBackgroundColour(this.currentBackground, 1)
|
|
1130
1143
|
}
|
|
1131
1144
|
},
|
|
1145
|
+
/**
|
|
1146
|
+
* @vuese
|
|
1147
|
+
* Function to process a list of a FC flatmap's systems.
|
|
1148
|
+
* @arg systems
|
|
1149
|
+
*/
|
|
1132
1150
|
processSystems: function (systems) {
|
|
1133
1151
|
this.systems.length = 0
|
|
1134
1152
|
if (systems && systems.length > 0) {
|
|
@@ -1148,6 +1166,13 @@ export default {
|
|
|
1148
1166
|
this.systems.push(data)
|
|
1149
1167
|
}
|
|
1150
1168
|
},
|
|
1169
|
+
/**
|
|
1170
|
+
* @vuese
|
|
1171
|
+
* Function to add taxon identifiers into the taxon connectivity array,
|
|
1172
|
+
* by retrieving their corresponding labels using the flatmap API.
|
|
1173
|
+
* @arg flatmapAPI,
|
|
1174
|
+
* @arg taxonIdentifiers
|
|
1175
|
+
*/
|
|
1151
1176
|
processTaxon: function (flatmapAPI, taxonIdentifiers) {
|
|
1152
1177
|
this.taxonConnectivity.length = 0
|
|
1153
1178
|
taxonIdentifiers.forEach((taxon) => {
|
|
@@ -1157,11 +1182,18 @@ export default {
|
|
|
1157
1182
|
})
|
|
1158
1183
|
})
|
|
1159
1184
|
},
|
|
1185
|
+
/**
|
|
1186
|
+
* @vuese
|
|
1187
|
+
* Function to show or hide the display of the bottom-left drawer container.
|
|
1188
|
+
*/
|
|
1160
1189
|
toggleDrawer: function () {
|
|
1161
1190
|
this.drawerOpen = !this.drawerOpen
|
|
1162
1191
|
},
|
|
1163
1192
|
/**
|
|
1193
|
+
* @vuese
|
|
1164
1194
|
* Function to toggle colour/greyscale of organs.
|
|
1195
|
+
* The parameter ``flag`` is a boolean, ``true`` (colour) and ``false`` (greyscale).
|
|
1196
|
+
* @arg flag
|
|
1165
1197
|
*/
|
|
1166
1198
|
setColour: function (flag) {
|
|
1167
1199
|
this.colourRadio = flag
|
|
@@ -1170,7 +1202,10 @@ export default {
|
|
|
1170
1202
|
}
|
|
1171
1203
|
},
|
|
1172
1204
|
/**
|
|
1205
|
+
* @vuese
|
|
1173
1206
|
* Function to toggle outlines f organs.
|
|
1207
|
+
* The parameter ``flag`` is a boolean, ``true`` to show outlines, ``false`` to hide outlines.
|
|
1208
|
+
* @arg flag
|
|
1174
1209
|
*/
|
|
1175
1210
|
setOutlines: function (flag) {
|
|
1176
1211
|
this.outlineRadio = flag
|
|
@@ -1179,6 +1214,7 @@ export default {
|
|
|
1179
1214
|
}
|
|
1180
1215
|
},
|
|
1181
1216
|
/**
|
|
1217
|
+
* @vuese
|
|
1182
1218
|
* Function to toggle paths to default.
|
|
1183
1219
|
* Also called when the associated button is pressed.
|
|
1184
1220
|
*/
|
|
@@ -1203,6 +1239,7 @@ export default {
|
|
|
1203
1239
|
}
|
|
1204
1240
|
},
|
|
1205
1241
|
/**
|
|
1242
|
+
* @vuese
|
|
1206
1243
|
* Function to zoom in.
|
|
1207
1244
|
* Also called when the associated button is pressed.
|
|
1208
1245
|
*/
|
|
@@ -1212,6 +1249,7 @@ export default {
|
|
|
1212
1249
|
}
|
|
1213
1250
|
},
|
|
1214
1251
|
/**
|
|
1252
|
+
* @vuese
|
|
1215
1253
|
* Function to zoom out.
|
|
1216
1254
|
* Also called when the associated button is pressed.
|
|
1217
1255
|
*/
|
|
@@ -1220,16 +1258,34 @@ export default {
|
|
|
1220
1258
|
this.mapImp.zoomOut()
|
|
1221
1259
|
}
|
|
1222
1260
|
},
|
|
1261
|
+
/**
|
|
1262
|
+
* @vuese
|
|
1263
|
+
* Function to show or hide centrelines and nodes.
|
|
1264
|
+
* The parameter ``payload`` is an object with a boolean property, ``value``,
|
|
1265
|
+
* ``payload.value = true/false``.
|
|
1266
|
+
* @arg payload
|
|
1267
|
+
*/
|
|
1223
1268
|
centreLinesSelected: function (payload) {
|
|
1224
1269
|
if (this.mapImp) {
|
|
1225
1270
|
this.mapImp.enableCentrelines(payload.value)
|
|
1226
1271
|
}
|
|
1227
1272
|
},
|
|
1273
|
+
/**
|
|
1274
|
+
* // Currently not in use
|
|
1275
|
+
* Function to show or hide paths valid in SCKAN
|
|
1276
|
+
* by providing ``{key, value}`` pair in ``payload``.
|
|
1277
|
+
* @arg payload
|
|
1278
|
+
*/
|
|
1228
1279
|
sckanSelected: function (payload) {
|
|
1229
1280
|
if (this.mapImp) {
|
|
1230
1281
|
this.mapImp.enableSckanPath(payload.key, payload.value)
|
|
1231
1282
|
}
|
|
1232
1283
|
},
|
|
1284
|
+
/**
|
|
1285
|
+
* // Currently not in use
|
|
1286
|
+
* Function to show or hide all paths valid in SCKAN.
|
|
1287
|
+
* @arg payload
|
|
1288
|
+
*/
|
|
1233
1289
|
checkAllSCKAN: function (payload) {
|
|
1234
1290
|
if (this.mapImp) {
|
|
1235
1291
|
payload.keys.forEach((key) =>
|
|
@@ -1237,6 +1293,12 @@ export default {
|
|
|
1237
1293
|
)
|
|
1238
1294
|
}
|
|
1239
1295
|
},
|
|
1296
|
+
/**
|
|
1297
|
+
* @vuese
|
|
1298
|
+
* Function to highlight the connected paths
|
|
1299
|
+
* by providing path model identifier, ``pathId``.
|
|
1300
|
+
* @arg pathId
|
|
1301
|
+
*/
|
|
1240
1302
|
highlightConnectedPaths: function (payload) {
|
|
1241
1303
|
if (this.mapImp) {
|
|
1242
1304
|
let paths = [...this.mapImp.pathModelNodes(payload)]
|
|
@@ -1253,11 +1315,23 @@ export default {
|
|
|
1253
1315
|
this.mapImp.zoomToFeatures(toHighlight, { noZoomIn: true })
|
|
1254
1316
|
}
|
|
1255
1317
|
},
|
|
1318
|
+
/**
|
|
1319
|
+
* @vuese
|
|
1320
|
+
* Function to enable/disable (show/hide) the system
|
|
1321
|
+
* by providing ``kay, value`` ``payload`` object ``{systemId, true/false}``.
|
|
1322
|
+
* @arg payload
|
|
1323
|
+
*/
|
|
1256
1324
|
systemSelected: function (payload) {
|
|
1257
1325
|
if (this.mapImp) {
|
|
1258
1326
|
this.mapImp.enableSystem(payload.key, payload.value)
|
|
1259
1327
|
}
|
|
1260
1328
|
},
|
|
1329
|
+
/**
|
|
1330
|
+
* @vuese
|
|
1331
|
+
* Function to enable/disable (show/hide) all systems
|
|
1332
|
+
* by providing ``flag`` (true/false).
|
|
1333
|
+
* @arg flag
|
|
1334
|
+
*/
|
|
1261
1335
|
checkAllSystems: function (flag) {
|
|
1262
1336
|
if (this.mapImp) {
|
|
1263
1337
|
this.systems[0].children.forEach((key) =>
|
|
@@ -1265,14 +1339,31 @@ export default {
|
|
|
1265
1339
|
)
|
|
1266
1340
|
}
|
|
1267
1341
|
},
|
|
1342
|
+
/**
|
|
1343
|
+
* @vuese
|
|
1344
|
+
* Function to display features with annotation matching the provided term.
|
|
1345
|
+
* @arg models
|
|
1346
|
+
*/
|
|
1268
1347
|
ftuSelected: function (models) {
|
|
1269
1348
|
this.searchAndShowResult(models, true)
|
|
1270
1349
|
},
|
|
1350
|
+
/**
|
|
1351
|
+
* @vuese
|
|
1352
|
+
* Function to show or hide the layer
|
|
1353
|
+
* by providing ``{layerId, true/false}`` in ``payload``.
|
|
1354
|
+
* @arg payload
|
|
1355
|
+
*/
|
|
1271
1356
|
layersSelected: function (payload) {
|
|
1272
1357
|
if (this.mapImp) {
|
|
1273
1358
|
this.mapImp.enableLayer(payload.key, payload.value)
|
|
1274
1359
|
}
|
|
1275
1360
|
},
|
|
1361
|
+
/**
|
|
1362
|
+
* @vuese
|
|
1363
|
+
* Function to show or hide all layers
|
|
1364
|
+
* by providing ``payload`` with ``payload.keys`` array and ``payload.value`` flag.
|
|
1365
|
+
* @arg payload
|
|
1366
|
+
*/
|
|
1276
1367
|
checkAllLayers: function (payload) {
|
|
1277
1368
|
if (this.mapImp) {
|
|
1278
1369
|
payload.keys.forEach((key) =>
|
|
@@ -1280,11 +1371,23 @@ export default {
|
|
|
1280
1371
|
)
|
|
1281
1372
|
}
|
|
1282
1373
|
},
|
|
1374
|
+
/**
|
|
1375
|
+
* @vuese
|
|
1376
|
+
* Function to show or hide connectivity features observed in particular species
|
|
1377
|
+
* by providing ``{taxonId, true/false}`` in ``payload.key, payload.value``.
|
|
1378
|
+
* @arg payload
|
|
1379
|
+
*/
|
|
1283
1380
|
taxonsSelected: function (payload) {
|
|
1284
1381
|
if (this.mapImp) {
|
|
1285
1382
|
this.mapImp.enableConnectivityByTaxonIds(payload.key, payload.value)
|
|
1286
1383
|
}
|
|
1287
1384
|
},
|
|
1385
|
+
/**
|
|
1386
|
+
* @vuese
|
|
1387
|
+
* Function to show or hide connectivity features observed in particular species
|
|
1388
|
+
* by providing ``payload`` with ``payload.keys`` array and ``payload.value`` flag.
|
|
1389
|
+
* @arg payload
|
|
1390
|
+
*/
|
|
1288
1391
|
checkAllTaxons: function (payload) {
|
|
1289
1392
|
if (this.mapImp) {
|
|
1290
1393
|
payload.keys.forEach((key) =>
|
|
@@ -1292,11 +1395,23 @@ export default {
|
|
|
1292
1395
|
)
|
|
1293
1396
|
}
|
|
1294
1397
|
},
|
|
1398
|
+
/**
|
|
1399
|
+
* @vuese
|
|
1400
|
+
* Function to hide or show paths of a given type
|
|
1401
|
+
* by providing ``{pathType, true/false}`` in ``payload.key, payload.value``.
|
|
1402
|
+
* @arg payload
|
|
1403
|
+
*/
|
|
1295
1404
|
pathwaysSelected: function (payload) {
|
|
1296
1405
|
if (this.mapImp) {
|
|
1297
1406
|
this.mapImp.enablePath(payload.key, payload.value)
|
|
1298
1407
|
}
|
|
1299
1408
|
},
|
|
1409
|
+
/**
|
|
1410
|
+
* @vuese
|
|
1411
|
+
* Function to hide or show paths of a given type
|
|
1412
|
+
* by providing ``payload`` with ``payload.keys`` array and ``payload.value`` flag.
|
|
1413
|
+
* @arg payload
|
|
1414
|
+
*/
|
|
1300
1415
|
checkAllPathways: function (payload) {
|
|
1301
1416
|
if (this.mapImp) {
|
|
1302
1417
|
payload.keys.forEach((key) =>
|
|
@@ -1304,9 +1419,21 @@ export default {
|
|
|
1304
1419
|
)
|
|
1305
1420
|
}
|
|
1306
1421
|
},
|
|
1422
|
+
/**
|
|
1423
|
+
* @vuese
|
|
1424
|
+
* Function to generate callbacks as a result of panning/zooming the map.
|
|
1425
|
+
* ``flag`` (boolean) - generate callbacks when ``true``, otherwise disable them.
|
|
1426
|
+
* @arg flag
|
|
1427
|
+
*/
|
|
1307
1428
|
enablePanZoomEvents: function (flag) {
|
|
1308
1429
|
this.mapImp.enablePanZoomEvents(flag)
|
|
1309
1430
|
},
|
|
1431
|
+
/**
|
|
1432
|
+
* @vuese
|
|
1433
|
+
* A callback function, invoked when events occur with the map.
|
|
1434
|
+
* The first parameter gives the type of event, the second provides details about the event.
|
|
1435
|
+
* _(This is the ``callback`` function from ``MapManager.loadMap()``)_.
|
|
1436
|
+
*/
|
|
1310
1437
|
eventCallback: function () {
|
|
1311
1438
|
return (eventType, data, ...args) => {
|
|
1312
1439
|
if (eventType === 'annotation') {
|
|
@@ -1318,17 +1445,21 @@ export default {
|
|
|
1318
1445
|
// Popup closed will trigger aborted event
|
|
1319
1446
|
if (data.type === 'aborted') {
|
|
1320
1447
|
// Rollback drawing when no new annotation submitted
|
|
1321
|
-
if (!this.annotationSubmitted)
|
|
1322
|
-
|
|
1323
|
-
}
|
|
1448
|
+
if (!this.annotationSubmitted) this.rollbackAnnotationEvent()
|
|
1449
|
+
else this.annotationSubmitted = false
|
|
1324
1450
|
} else if (data.type === 'modeChanged') {
|
|
1325
1451
|
// 'modeChanged' event is before 'created' event
|
|
1326
1452
|
if (data.feature.mode.startsWith('draw_')) {
|
|
1327
1453
|
// Reset data entry for every draw
|
|
1328
|
-
this.
|
|
1454
|
+
this.initialiseDialog()
|
|
1329
1455
|
this.inDrawing = true
|
|
1330
1456
|
} else if (data.feature.mode === 'simple_select' && this.inDrawing) {
|
|
1331
|
-
this.
|
|
1457
|
+
if (this.createdEvent) {
|
|
1458
|
+
this.relevanceDisplay = true
|
|
1459
|
+
} else {
|
|
1460
|
+
// Reset if a invalid draw
|
|
1461
|
+
this.initialiseDrawing()
|
|
1462
|
+
}
|
|
1332
1463
|
} else if (data.feature.mode === 'direct_select') {
|
|
1333
1464
|
this.doubleClickedFeature = true
|
|
1334
1465
|
}
|
|
@@ -1338,8 +1469,14 @@ export default {
|
|
|
1338
1469
|
undefined :
|
|
1339
1470
|
data.feature.features[0]
|
|
1340
1471
|
payload.feature.feature = this.currentDrawnFeature
|
|
1341
|
-
|
|
1342
|
-
|
|
1472
|
+
if (!this.inDrawing) {
|
|
1473
|
+
this.initialiseDialog()
|
|
1474
|
+
// For exist drawn annotation features
|
|
1475
|
+
if (this.currentDrawnFeature) {
|
|
1476
|
+
this.processRelevance()
|
|
1477
|
+
this.checkAndCreateDrawnFeaturePopups(payload)
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1343
1480
|
} else {
|
|
1344
1481
|
if (data.type === 'created' || data.type === 'updated') {
|
|
1345
1482
|
if (data.type === 'updated' && data.feature.action) {
|
|
@@ -1364,6 +1501,15 @@ export default {
|
|
|
1364
1501
|
const resource = [data.models]
|
|
1365
1502
|
const taxonomy = this.entry
|
|
1366
1503
|
const biologicalSex = this.biologicalSex
|
|
1504
|
+
let taxons = undefined
|
|
1505
|
+
if (data.taxons) {
|
|
1506
|
+
// check if data.taxons is string or array
|
|
1507
|
+
if (typeof data.taxons !== 'object') {
|
|
1508
|
+
taxons = JSON.parse(data.taxons)
|
|
1509
|
+
} else {
|
|
1510
|
+
taxons = data.taxons
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1367
1513
|
const payload = {
|
|
1368
1514
|
dataset: data.dataset,
|
|
1369
1515
|
biologicalSex: biologicalSex,
|
|
@@ -1373,16 +1519,18 @@ export default {
|
|
|
1373
1519
|
feature: data,
|
|
1374
1520
|
userData: args,
|
|
1375
1521
|
eventType: eventType,
|
|
1376
|
-
provenanceTaxonomy:
|
|
1377
|
-
? JSON.parse(data.taxons)
|
|
1378
|
-
: undefined,
|
|
1522
|
+
provenanceTaxonomy: taxons,
|
|
1379
1523
|
}
|
|
1380
1524
|
if (eventType === 'click') {
|
|
1525
|
+
this.featuresAlert = data.alert
|
|
1381
1526
|
if (this.viewingMode === 'Network Discovery') {
|
|
1382
1527
|
this.highlightConnectedPaths([data.models])
|
|
1383
1528
|
} else {
|
|
1384
1529
|
this.currentActive = data.models ? data.models : ''
|
|
1385
|
-
|
|
1530
|
+
// Stop adding features if dialog displayed
|
|
1531
|
+
if (this.inDrawing && !this.relevanceDisplay ) {
|
|
1532
|
+
this.processRelevance(payload)
|
|
1533
|
+
}
|
|
1386
1534
|
}
|
|
1387
1535
|
} else if (
|
|
1388
1536
|
eventType === 'mouseenter' &&
|
|
@@ -1407,60 +1555,115 @@ export default {
|
|
|
1407
1555
|
}
|
|
1408
1556
|
}
|
|
1409
1557
|
},
|
|
1410
|
-
|
|
1558
|
+
// for dialog popup
|
|
1559
|
+
dialogCssHacks: function () {
|
|
1560
|
+
this.$nextTick(() => {
|
|
1561
|
+
const dialog = this.$el.querySelector('.relevance-dialog')
|
|
1562
|
+
draggable(this.$el, dialog)
|
|
1563
|
+
// dialog popup at the click position
|
|
1564
|
+
// slightly change x or y if close to boundary
|
|
1565
|
+
let posX, posY
|
|
1566
|
+
const containerRect = this.$el.getBoundingClientRect()
|
|
1567
|
+
const dialogRect = dialog.getBoundingClientRect()
|
|
1568
|
+
if (this.dialogPosition.x > containerRect.width / 2) {
|
|
1569
|
+
posX = this.dialogPosition.x - dialogRect.width
|
|
1570
|
+
} else {
|
|
1571
|
+
posX = this.dialogPosition.x
|
|
1572
|
+
}
|
|
1573
|
+
if (this.dialogPosition.y > containerRect.height / 2) {
|
|
1574
|
+
posY = this.dialogPosition.y - dialogRect.height
|
|
1575
|
+
} else {
|
|
1576
|
+
posY = this.dialogPosition.y
|
|
1577
|
+
}
|
|
1578
|
+
dialog.style.transform =
|
|
1579
|
+
`translate(${posX - this.dialogPosition.offsetX}px, ${posY - this.dialogPosition.offsetY}px)`
|
|
1580
|
+
})
|
|
1581
|
+
},
|
|
1582
|
+
drawIconCssHacks: function () {
|
|
1583
|
+
// set tool/mode icon status
|
|
1584
|
+
if (this.$el.querySelector('.iconSelected') || !this.relevanceDisplay) {
|
|
1585
|
+
this.drawnTypes.map((t) => {
|
|
1586
|
+
const dtype = this.$el.querySelector(`.draw${t}`)
|
|
1587
|
+
if (dtype) {
|
|
1588
|
+
dtype.classList.remove('iconSelected');
|
|
1589
|
+
dtype.classList.remove('inactive');
|
|
1590
|
+
}
|
|
1591
|
+
})
|
|
1592
|
+
this.drawModes.map((m) => {
|
|
1593
|
+
this.$el.querySelector(`.draw${m}`).classList.remove('iconSelected');
|
|
1594
|
+
this.$el.querySelector(`.draw${m}`).classList.remove('inactive');
|
|
1595
|
+
})
|
|
1596
|
+
}
|
|
1597
|
+
if (this.activeDrawTool) {
|
|
1598
|
+
this.$el.querySelector(`.draw${this.activeDrawTool}`).classList.add('iconSelected');
|
|
1599
|
+
this.drawModes.map((m) => {
|
|
1600
|
+
this.$el.querySelector(`.draw${m}`).classList.add('inactive');
|
|
1601
|
+
})
|
|
1602
|
+
} else if (this.activeDrawMode || this.relevanceDisplay) {
|
|
1603
|
+
if (this.activeDrawMode) {
|
|
1604
|
+
this.$el.querySelector(`.draw${this.activeDrawMode}`).classList.add('iconSelected');
|
|
1605
|
+
}
|
|
1606
|
+
this.drawnTypes.map((t) => {
|
|
1607
|
+
const dtype = this.$el.querySelector(`.draw${t}`)
|
|
1608
|
+
if (dtype) dtype.classList.add('inactive');
|
|
1609
|
+
})
|
|
1610
|
+
}
|
|
1611
|
+
},
|
|
1612
|
+
processRelevance: function (data = undefined) {
|
|
1613
|
+
// process while drawing new features
|
|
1411
1614
|
if (data && data.feature) {
|
|
1412
1615
|
// Only clicked relevance data will be added
|
|
1413
|
-
let
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1616
|
+
let relevant = data.feature.models ? data.feature.models : data.feature.featureId
|
|
1617
|
+
// only the linestring will have relevance at the current stage
|
|
1618
|
+
if (relevant && this.activeDrawTool === 'LineString') {
|
|
1619
|
+
this.relevanceEntry[relevant] = data
|
|
1620
|
+
}
|
|
1621
|
+
} else {
|
|
1622
|
+
// process while checking exist features
|
|
1623
|
+
if (this.currentDrawnFeature && this.drawnAnnotationFeatures) {
|
|
1624
|
+
let feature = this.drawnAnnotationFeatures
|
|
1625
|
+
.filter((feature) => {
|
|
1626
|
+
return feature.id === this.currentDrawnFeature.id
|
|
1627
|
+
})[0]
|
|
1628
|
+
if (feature && feature.relevance) {
|
|
1629
|
+
this.relevanceEntry = feature.relevance
|
|
1630
|
+
}
|
|
1424
1631
|
}
|
|
1425
|
-
} else if (this.currentDrawnFeature && this.drawnAnnotationFeatures) {
|
|
1426
|
-
let relevance = this.drawnAnnotationFeatures
|
|
1427
|
-
.filter((feature) => {
|
|
1428
|
-
return feature.id === this.currentDrawnFeature.id
|
|
1429
|
-
})[0].relevance
|
|
1430
|
-
if (relevance) this.relevanceEntry = relevance
|
|
1431
1632
|
}
|
|
1432
1633
|
},
|
|
1634
|
+
// This is used only when either edit or delete mode is on
|
|
1433
1635
|
checkAndCreateDrawnFeaturePopups: function (data) {
|
|
1434
|
-
if (
|
|
1435
|
-
|
|
1436
|
-
if (this.
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
options: { featureIds: [data.feature.feature.id] }
|
|
1455
|
-
})
|
|
1456
|
-
this.trashAnnotationFeature()
|
|
1457
|
-
}
|
|
1458
|
-
}
|
|
1636
|
+
if (this.activeDrawMode) {
|
|
1637
|
+
// double click fires 'updated' callback
|
|
1638
|
+
if (this.doubleClickedFeature) {
|
|
1639
|
+
if (data.feature.feature.geometry.type !== 'Point') {
|
|
1640
|
+
// show tooltip and enter edit mode
|
|
1641
|
+
this.changeAnnotationDrawMode({
|
|
1642
|
+
mode: 'direct_select',
|
|
1643
|
+
options: { featureId: data.feature.feature.id }
|
|
1644
|
+
})
|
|
1645
|
+
this.trashAnnotationFeature()
|
|
1646
|
+
}
|
|
1647
|
+
this.doubleClickedFeature = false
|
|
1648
|
+
} else {
|
|
1649
|
+
// single click fires delete
|
|
1650
|
+
if (this.activeDrawMode === 'Delete') {
|
|
1651
|
+
this.changeAnnotationDrawMode({
|
|
1652
|
+
mode: 'simple_select',
|
|
1653
|
+
options: { featureIds: [data.feature.feature.id] }
|
|
1654
|
+
})
|
|
1655
|
+
this.trashAnnotationFeature()
|
|
1459
1656
|
}
|
|
1460
1657
|
}
|
|
1461
1658
|
}
|
|
1462
1659
|
},
|
|
1463
1660
|
// checkNeuronClicked shows a neuron path pop up if a path was recently clicked
|
|
1661
|
+
/**
|
|
1662
|
+
* @vuese
|
|
1663
|
+
* Function to create/display tooltips from the provided ``data``.
|
|
1664
|
+
* _checkNeuronClicked shows a neuron path pop up if a path was recently clicked._
|
|
1665
|
+
* @arg data
|
|
1666
|
+
*/
|
|
1464
1667
|
checkAndCreatePopups: async function (data) {
|
|
1465
1668
|
// Call flatmap database to get the connection data
|
|
1466
1669
|
if (this.viewingMode === 'Annotation') {
|
|
@@ -1475,14 +1678,20 @@ export default {
|
|
|
1475
1678
|
if (this.inDrawing || this.activeDrawMode) {
|
|
1476
1679
|
this.annotationSubmitted = false
|
|
1477
1680
|
this.annotationEntry.featureId = data.feature.feature.id
|
|
1478
|
-
|
|
1479
|
-
|
|
1681
|
+
this.displayTooltip(
|
|
1682
|
+
data.feature.feature.id,
|
|
1683
|
+
centroid(data.feature.feature.geometry)
|
|
1684
|
+
)
|
|
1480
1685
|
} else {
|
|
1481
|
-
// Not allowed to update feature if edit mode
|
|
1686
|
+
// Not allowed to update feature if not on edit mode
|
|
1482
1687
|
if (data.feature.type === 'updated') {
|
|
1483
1688
|
this.rollbackAnnotationEvent()
|
|
1484
1689
|
}
|
|
1485
1690
|
}
|
|
1691
|
+
// Hide dialog when updated or deleted event is fired and tooltip is displayed
|
|
1692
|
+
if (data.feature.type === 'updated' || data.feature.type === 'deleted') {
|
|
1693
|
+
this.initialiseDialog()
|
|
1694
|
+
}
|
|
1486
1695
|
}
|
|
1487
1696
|
} else {
|
|
1488
1697
|
this.annotation = {}
|
|
@@ -1503,6 +1712,9 @@ export default {
|
|
|
1503
1712
|
}
|
|
1504
1713
|
}
|
|
1505
1714
|
},
|
|
1715
|
+
/**
|
|
1716
|
+
* A hack to remove flatmap tooltips while popup is open
|
|
1717
|
+
*/
|
|
1506
1718
|
popUpCssHacks: function () {
|
|
1507
1719
|
// Below is a hack to remove flatmap tooltips while popup is open
|
|
1508
1720
|
let ftooltip = document.querySelector('.flatmap-tooltip-popup')
|
|
@@ -1518,18 +1730,34 @@ export default {
|
|
|
1518
1730
|
let cbutton = document.querySelector('.maplibregl-popup-close-button')
|
|
1519
1731
|
if (cbutton) cbutton.click()
|
|
1520
1732
|
},
|
|
1733
|
+
/**
|
|
1734
|
+
* @vuese
|
|
1735
|
+
* Function to close tooltip.
|
|
1736
|
+
*/
|
|
1521
1737
|
closeTooltip: function () {
|
|
1522
1738
|
this.$refs.tooltip.$el.style.display = 'none'
|
|
1523
1739
|
document.querySelectorAll('.maplibregl-popup').forEach((item) => {
|
|
1524
1740
|
item.style.display = 'none'
|
|
1525
1741
|
})
|
|
1526
1742
|
},
|
|
1743
|
+
/**
|
|
1744
|
+
* @vuese
|
|
1745
|
+
* Function to create tooltip from Neuron Curation ``data``.
|
|
1746
|
+
* @arg data
|
|
1747
|
+
*/
|
|
1527
1748
|
createTooltipFromNeuronCuration: async function (data) {
|
|
1528
1749
|
this.tooltipEntry = await this.flatmapQueries.createTooltipData(data)
|
|
1529
1750
|
this.displayTooltip(data.resource[0])
|
|
1530
1751
|
},
|
|
1531
|
-
|
|
1752
|
+
/**
|
|
1753
|
+
* @vuese
|
|
1754
|
+
* Function to show popup on map.
|
|
1755
|
+
* @arg featureId,
|
|
1756
|
+
* @arg node,
|
|
1757
|
+
* @arg options
|
|
1758
|
+
*/
|
|
1532
1759
|
showPopup: function (featureId, node, options) {
|
|
1760
|
+
// Keeping this as an API
|
|
1533
1761
|
let myOptions = options
|
|
1534
1762
|
if (this.mapImp) {
|
|
1535
1763
|
if (myOptions) {
|
|
@@ -1540,11 +1768,22 @@ export default {
|
|
|
1540
1768
|
this.mapImp.showPopup(featureId, node, myOptions)
|
|
1541
1769
|
}
|
|
1542
1770
|
},
|
|
1771
|
+
/**
|
|
1772
|
+
* @vuese
|
|
1773
|
+
* Function to show marker popup.
|
|
1774
|
+
* @arg featureId,
|
|
1775
|
+
* @arg node,
|
|
1776
|
+
* @arg options
|
|
1777
|
+
*/
|
|
1543
1778
|
showMarkerPopup: function (featureId, node, options) {
|
|
1544
1779
|
if (this.mapImp) {
|
|
1545
1780
|
this.mapImp.showMarkerPopup(featureId, node, options)
|
|
1546
1781
|
}
|
|
1547
1782
|
},
|
|
1783
|
+
/**
|
|
1784
|
+
* @vuese
|
|
1785
|
+
* Function to close minimap.
|
|
1786
|
+
*/
|
|
1548
1787
|
closeMinimap: function () {
|
|
1549
1788
|
let minimapEl = this.$refs.flatmapContainer.querySelector(
|
|
1550
1789
|
'.maplibregl-ctrl-minimap'
|
|
@@ -1559,6 +1798,9 @@ export default {
|
|
|
1559
1798
|
}
|
|
1560
1799
|
this.minimapSmall = !this.minimapSmall
|
|
1561
1800
|
},
|
|
1801
|
+
/**
|
|
1802
|
+
* Function to add resize button to minimap.
|
|
1803
|
+
*/
|
|
1562
1804
|
addResizeButtonToMinimap: function () {
|
|
1563
1805
|
let minimapEl = this.$refs.flatmapContainer.querySelector(
|
|
1564
1806
|
'.maplibregl-ctrl-minimap'
|
|
@@ -1573,6 +1815,12 @@ export default {
|
|
|
1573
1815
|
this.minimapResizeShow = true
|
|
1574
1816
|
}
|
|
1575
1817
|
},
|
|
1818
|
+
/**
|
|
1819
|
+
* @vuese
|
|
1820
|
+
* Function to set help mode
|
|
1821
|
+
* by providing flag ``helpMode`` (true/false).
|
|
1822
|
+
* @arg helpMode
|
|
1823
|
+
*/
|
|
1576
1824
|
setHelpMode: function (helpMode) {
|
|
1577
1825
|
if (helpMode) {
|
|
1578
1826
|
this.inHelp = true
|
|
@@ -1588,6 +1836,12 @@ export default {
|
|
|
1588
1836
|
this.closeFlatmapHelpPopup()
|
|
1589
1837
|
}
|
|
1590
1838
|
},
|
|
1839
|
+
/**
|
|
1840
|
+
* @vuese
|
|
1841
|
+
* Function to show tooltip
|
|
1842
|
+
* by providing ``tooltipNumber``.
|
|
1843
|
+
* @arg tooltipNumber
|
|
1844
|
+
*/
|
|
1591
1845
|
showToolitip: function (tooltipNumber) {
|
|
1592
1846
|
if (!this.inHelp) {
|
|
1593
1847
|
clearTimeout(this.tooltipWait[tooltipNumber])
|
|
@@ -1596,6 +1850,12 @@ export default {
|
|
|
1596
1850
|
}, 500)
|
|
1597
1851
|
}
|
|
1598
1852
|
},
|
|
1853
|
+
/**
|
|
1854
|
+
* @vuese
|
|
1855
|
+
* Function to hide tooltip
|
|
1856
|
+
* by providing ``tooltipNumber``.
|
|
1857
|
+
* @arg tooltipNumber
|
|
1858
|
+
*/
|
|
1599
1859
|
hideToolitip: function (tooltipNumber) {
|
|
1600
1860
|
if (!this.inHelp) {
|
|
1601
1861
|
clearTimeout(this.tooltipWait[tooltipNumber])
|
|
@@ -1604,6 +1864,12 @@ export default {
|
|
|
1604
1864
|
}, 500)
|
|
1605
1865
|
}
|
|
1606
1866
|
},
|
|
1867
|
+
/**
|
|
1868
|
+
* @vuese
|
|
1869
|
+
* Function to display tooltip
|
|
1870
|
+
* by providing featureId (``feature``).
|
|
1871
|
+
* @arg feature
|
|
1872
|
+
*/
|
|
1607
1873
|
displayTooltip: function (feature, geometry = undefined) {
|
|
1608
1874
|
this.tooltipDisplay = true
|
|
1609
1875
|
let featureId = undefined
|
|
@@ -1618,10 +1884,16 @@ export default {
|
|
|
1618
1884
|
}
|
|
1619
1885
|
}
|
|
1620
1886
|
if (!this.disableUI) {
|
|
1621
|
-
this
|
|
1887
|
+
this.$nextTick(() => {
|
|
1888
|
+
this.mapImp.showPopup(featureId, this.$refs.tooltip.$el, options)
|
|
1889
|
+
this.popUpCssHacks()
|
|
1890
|
+
})
|
|
1622
1891
|
}
|
|
1623
|
-
this.popUpCssHacks()
|
|
1624
1892
|
},
|
|
1893
|
+
/**
|
|
1894
|
+
* @vuese
|
|
1895
|
+
* Function to open Flatmap Help Popup.
|
|
1896
|
+
*/
|
|
1625
1897
|
openFlatmapHelpPopup: function () {
|
|
1626
1898
|
if (this.mapImp) {
|
|
1627
1899
|
let heartId = this.mapImp.modelFeatureIds('UBERON:0000948')
|
|
@@ -1634,6 +1906,10 @@ export default {
|
|
|
1634
1906
|
}
|
|
1635
1907
|
}
|
|
1636
1908
|
},
|
|
1909
|
+
/**
|
|
1910
|
+
* @vuese
|
|
1911
|
+
* Function to close Flatmap Help Popup.
|
|
1912
|
+
*/
|
|
1637
1913
|
closeFlatmapHelpPopup: function () {
|
|
1638
1914
|
this.$el
|
|
1639
1915
|
.querySelectorAll('.maplibregl-popup-close-button')
|
|
@@ -1641,6 +1917,10 @@ export default {
|
|
|
1641
1917
|
item.click()
|
|
1642
1918
|
})
|
|
1643
1919
|
},
|
|
1920
|
+
/**
|
|
1921
|
+
* @vuese
|
|
1922
|
+
* Function to get annotation labels.
|
|
1923
|
+
*/
|
|
1644
1924
|
getLabels: function () {
|
|
1645
1925
|
let labels = []
|
|
1646
1926
|
if (this.mapImp) {
|
|
@@ -1651,6 +1931,10 @@ export default {
|
|
|
1651
1931
|
return Array.from(new Set(labels))
|
|
1652
1932
|
}
|
|
1653
1933
|
},
|
|
1934
|
+
/**
|
|
1935
|
+
* @vuese
|
|
1936
|
+
* Function to get the state (object) of the map.
|
|
1937
|
+
*/
|
|
1654
1938
|
getState: function () {
|
|
1655
1939
|
if (this.mapImp) {
|
|
1656
1940
|
let state = {
|
|
@@ -1666,6 +1950,11 @@ export default {
|
|
|
1666
1950
|
}
|
|
1667
1951
|
return undefined
|
|
1668
1952
|
},
|
|
1953
|
+
/**
|
|
1954
|
+
* @vuese
|
|
1955
|
+
* Function to set state (object) for the map.
|
|
1956
|
+
* @arg state
|
|
1957
|
+
*/
|
|
1669
1958
|
setState: function (state) {
|
|
1670
1959
|
if (state) {
|
|
1671
1960
|
if (
|
|
@@ -1683,12 +1972,40 @@ export default {
|
|
|
1683
1972
|
this.setStateRequired = false
|
|
1684
1973
|
}
|
|
1685
1974
|
},
|
|
1975
|
+
/**
|
|
1976
|
+
* @vuese
|
|
1977
|
+
* Function to restore map's state
|
|
1978
|
+
* from the ``state`` provided.
|
|
1979
|
+
* @arg state
|
|
1980
|
+
*/
|
|
1686
1981
|
restoreMapState: function (state) {
|
|
1687
1982
|
if (state) {
|
|
1688
1983
|
if (state.viewport) this.mapImp.setState(state.viewport)
|
|
1689
1984
|
if (state.searchTerm) this.searchAndShowResult(state.searchTerm, true)
|
|
1690
1985
|
}
|
|
1691
1986
|
},
|
|
1987
|
+
/**
|
|
1988
|
+
* @vuese
|
|
1989
|
+
* Function to show flight path option
|
|
1990
|
+
* (3D option)
|
|
1991
|
+
* based on the map version (currently 1.6 and above).
|
|
1992
|
+
* @arg mapVersion
|
|
1993
|
+
*/
|
|
1994
|
+
setFlightPathInfo: function (mapVersion) {
|
|
1995
|
+
const mapVersionForFlightPath = 1.6
|
|
1996
|
+
if (mapVersion === mapVersionForFlightPath || mapVersion > mapVersionForFlightPath) {
|
|
1997
|
+
// Show flight path option UI
|
|
1998
|
+
this.displayFlightPathOption = true
|
|
1999
|
+
// Show 3D as default on FC type
|
|
2000
|
+
this.setFlightPath3D(true)
|
|
2001
|
+
}
|
|
2002
|
+
},
|
|
2003
|
+
/**
|
|
2004
|
+
* @vuese
|
|
2005
|
+
* Function to create Flatmap
|
|
2006
|
+
* by providing the ``state``.
|
|
2007
|
+
* @arg state
|
|
2008
|
+
*/
|
|
1692
2009
|
createFlatmap: function (state) {
|
|
1693
2010
|
if (!this.mapImp && !this.loading) {
|
|
1694
2011
|
this.loading = true
|
|
@@ -1746,11 +2063,7 @@ export default {
|
|
|
1746
2063
|
//fullscreenControl: false,
|
|
1747
2064
|
//annotatable: false,
|
|
1748
2065
|
//debug: true,
|
|
1749
|
-
|
|
1750
|
-
'min-zoom': this.minZoom,
|
|
1751
|
-
layerControl: true,
|
|
1752
|
-
pathControls: true,
|
|
1753
|
-
searchable: this.searchable,
|
|
2066
|
+
minZoom: this.minZoom,
|
|
1754
2067
|
tooltips: this.tooltips,
|
|
1755
2068
|
minimap: minimap,
|
|
1756
2069
|
}
|
|
@@ -1758,6 +2071,8 @@ export default {
|
|
|
1758
2071
|
promise1.then((returnedObject) => {
|
|
1759
2072
|
this.mapImp = returnedObject
|
|
1760
2073
|
this.serverUUID = this.mapImp.getIdentifier().uuid
|
|
2074
|
+
let mapVersion = this.mapImp.details.version
|
|
2075
|
+
this.setFlightPathInfo(mapVersion)
|
|
1761
2076
|
this.onFlatmapReady()
|
|
1762
2077
|
if (this._stateToBeSet) this.restoreMapState(this._stateToBeSet)
|
|
1763
2078
|
else {
|
|
@@ -1773,6 +2088,10 @@ export default {
|
|
|
1773
2088
|
this.restoreMapState(this._stateToBeSet)
|
|
1774
2089
|
}
|
|
1775
2090
|
},
|
|
2091
|
+
/**
|
|
2092
|
+
* @vuese
|
|
2093
|
+
* Function to compute path controls maximum height.
|
|
2094
|
+
*/
|
|
1776
2095
|
computePathControlsMaximumHeight() {
|
|
1777
2096
|
const elem = this.$refs.display
|
|
1778
2097
|
if (elem) {
|
|
@@ -1783,6 +2102,10 @@ export default {
|
|
|
1783
2102
|
this.pathwaysMaxHeight = height - 170
|
|
1784
2103
|
}
|
|
1785
2104
|
},
|
|
2105
|
+
/**
|
|
2106
|
+
* @vuese
|
|
2107
|
+
* Function to resize the map.
|
|
2108
|
+
*/
|
|
1786
2109
|
mapResize: function () {
|
|
1787
2110
|
try {
|
|
1788
2111
|
this.computePathControlsMaximumHeight()
|
|
@@ -1797,6 +2120,10 @@ export default {
|
|
|
1797
2120
|
console.error('Map resize error')
|
|
1798
2121
|
}
|
|
1799
2122
|
},
|
|
2123
|
+
/**
|
|
2124
|
+
* @vuese
|
|
2125
|
+
* This function is used for functions that need to run immediately after the flatmap is loaded.
|
|
2126
|
+
*/
|
|
1800
2127
|
onFlatmapReady: function () {
|
|
1801
2128
|
// onFlatmapReady is used for functions that need to run immediately after the flatmap is loaded
|
|
1802
2129
|
this.sensor = new ResizeSensor(this.$refs.display, this.mapResize)
|
|
@@ -1816,17 +2143,36 @@ export default {
|
|
|
1816
2143
|
this.computePathControlsMaximumHeight()
|
|
1817
2144
|
this.drawerOpen = true
|
|
1818
2145
|
this.mapResize()
|
|
2146
|
+
/**
|
|
2147
|
+
* This is ``onFlatmapReady`` event.
|
|
2148
|
+
* @arg ``this`` (Component Vue Instance)
|
|
2149
|
+
*/
|
|
1819
2150
|
this.$emit('ready', this)
|
|
1820
2151
|
},
|
|
2152
|
+
/**
|
|
2153
|
+
* @vuese
|
|
2154
|
+
* Function to show or hide the minimap
|
|
2155
|
+
* by providing ``flag`` (boolean) value.
|
|
2156
|
+
* @arg flag
|
|
2157
|
+
*/
|
|
1821
2158
|
showMinimap: function (flag) {
|
|
1822
2159
|
if (this.mapImp) this.mapImp.showMinimap(flag)
|
|
1823
2160
|
},
|
|
2161
|
+
/**
|
|
2162
|
+
* @vuese
|
|
2163
|
+
* Function to show or hide the pathways drawer
|
|
2164
|
+
* by providing ``flag`` (boolean) value.
|
|
2165
|
+
* @arg flag
|
|
2166
|
+
*/
|
|
1824
2167
|
showPathwaysDrawer: function (flag) {
|
|
1825
2168
|
this.drawerOpen = flag
|
|
1826
2169
|
},
|
|
1827
2170
|
/**
|
|
2171
|
+
* @vuese
|
|
1828
2172
|
* Function to display features with annotation matching the provided term,
|
|
1829
2173
|
* with the option to display the label using displayLabel flag.
|
|
2174
|
+
* @arg term,
|
|
2175
|
+
* @arg displayLabel
|
|
1830
2176
|
*/
|
|
1831
2177
|
searchAndShowResult: function (term, displayLabel) {
|
|
1832
2178
|
if (this.mapImp) {
|
|
@@ -1866,7 +2212,10 @@ export default {
|
|
|
1866
2212
|
return false
|
|
1867
2213
|
},
|
|
1868
2214
|
/**
|
|
1869
|
-
*
|
|
2215
|
+
* @vuese
|
|
2216
|
+
* Function to show search suggestions
|
|
2217
|
+
* from the ``term`` provided.
|
|
2218
|
+
* @arg term
|
|
1870
2219
|
*/
|
|
1871
2220
|
searchSuggestions: function (term) {
|
|
1872
2221
|
if (this.mapImp) return this.mapImp.search(term)
|
|
@@ -1874,48 +2223,66 @@ export default {
|
|
|
1874
2223
|
},
|
|
1875
2224
|
},
|
|
1876
2225
|
props: {
|
|
1877
|
-
|
|
2226
|
+
/**
|
|
2227
|
+
* The taxon identifier of the species represented by the map.
|
|
2228
|
+
*/
|
|
2229
|
+
entry: {
|
|
2230
|
+
type: String,
|
|
2231
|
+
required: true,
|
|
2232
|
+
},
|
|
2233
|
+
/**
|
|
2234
|
+
* The unique ``uuid`` of the flatmap.
|
|
2235
|
+
* If given then this exact map will be loaded,
|
|
2236
|
+
* overriding ``taxon`` and ``biologicalSex``.
|
|
2237
|
+
*/
|
|
1878
2238
|
uuid: String,
|
|
2239
|
+
/**
|
|
2240
|
+
* The biological sex of the species represented by the map.
|
|
2241
|
+
* This is specified as metadata in the map's source file.
|
|
2242
|
+
*/
|
|
1879
2243
|
biologicalSex: {
|
|
1880
2244
|
type: String,
|
|
1881
2245
|
default: '',
|
|
1882
2246
|
},
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
},
|
|
2247
|
+
/**
|
|
2248
|
+
* The minimum zoom level of the map.
|
|
2249
|
+
*/
|
|
1887
2250
|
minZoom: {
|
|
1888
2251
|
type: Number,
|
|
1889
2252
|
default: 4,
|
|
1890
2253
|
},
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
searchable: {
|
|
1896
|
-
type: Boolean,
|
|
1897
|
-
default: false,
|
|
1898
|
-
},
|
|
1899
|
-
layerControl: {
|
|
1900
|
-
type: Boolean,
|
|
1901
|
-
default: false,
|
|
1902
|
-
},
|
|
2254
|
+
/**
|
|
2255
|
+
* The option to add another feature label _(`FeatureSmallSymbolLayer`)_
|
|
2256
|
+
* when this `tooltips` is set to `false`.
|
|
2257
|
+
*/
|
|
1903
2258
|
tooltips: {
|
|
1904
2259
|
type: Boolean,
|
|
1905
2260
|
default: true,
|
|
1906
2261
|
},
|
|
2262
|
+
/**
|
|
2263
|
+
* The option to show tooltips for help mode.
|
|
2264
|
+
*/
|
|
1907
2265
|
helpMode: {
|
|
1908
2266
|
type: Boolean,
|
|
1909
2267
|
default: false,
|
|
1910
2268
|
},
|
|
2269
|
+
/**
|
|
2270
|
+
* The option to create map on component mounted.
|
|
2271
|
+
*/
|
|
1911
2272
|
renderAtMounted: {
|
|
1912
2273
|
type: Boolean,
|
|
1913
2274
|
default: true,
|
|
1914
2275
|
},
|
|
2276
|
+
/**
|
|
2277
|
+
* The option to display minimap at the top-right corner of the map.
|
|
2278
|
+
*/
|
|
1915
2279
|
displayMinimap: {
|
|
1916
2280
|
type: Boolean,
|
|
1917
2281
|
default: false,
|
|
1918
2282
|
},
|
|
2283
|
+
/**
|
|
2284
|
+
* The option to show warning. Example for legacy or beta maps.
|
|
2285
|
+
*/
|
|
1919
2286
|
displayWarning: {
|
|
1920
2287
|
type: Boolean,
|
|
1921
2288
|
default: false,
|
|
@@ -1928,8 +2295,28 @@ export default {
|
|
|
1928
2295
|
type: Boolean,
|
|
1929
2296
|
default: false,
|
|
1930
2297
|
},
|
|
2298
|
+
/**
|
|
2299
|
+
* The data to show different map options.
|
|
2300
|
+
* Available at the bottom-left corner ("Open new map" tooltip).
|
|
2301
|
+
*/
|
|
1931
2302
|
openMapOptions: {
|
|
1932
2303
|
type: Array,
|
|
2304
|
+
/**
|
|
2305
|
+
* ```[
|
|
2306
|
+
{
|
|
2307
|
+
display: 'Open AC Map',
|
|
2308
|
+
key: 'AC',
|
|
2309
|
+
},
|
|
2310
|
+
{
|
|
2311
|
+
display: 'Open FC Map',
|
|
2312
|
+
key: 'FC',
|
|
2313
|
+
},
|
|
2314
|
+
{
|
|
2315
|
+
display: 'Open 3D Human Map',
|
|
2316
|
+
key: '3D',
|
|
2317
|
+
},
|
|
2318
|
+
]```
|
|
2319
|
+
*/
|
|
1933
2320
|
default: function () {
|
|
1934
2321
|
return [
|
|
1935
2322
|
{
|
|
@@ -1947,14 +2334,24 @@ export default {
|
|
|
1947
2334
|
]
|
|
1948
2335
|
},
|
|
1949
2336
|
},
|
|
2337
|
+
/**
|
|
2338
|
+
* The option to show star in legend area.
|
|
2339
|
+
*/
|
|
1950
2340
|
showStarInLegend: {
|
|
1951
2341
|
type: Boolean,
|
|
1952
2342
|
default: false,
|
|
1953
2343
|
},
|
|
2344
|
+
/**
|
|
2345
|
+
* Flag to determine whether this is legacy map or not.
|
|
2346
|
+
* ``displayWarning`` should be shown for legacy map.
|
|
2347
|
+
*/
|
|
1954
2348
|
isLegacy: {
|
|
1955
2349
|
type: Boolean,
|
|
1956
2350
|
default: false,
|
|
1957
2351
|
},
|
|
2352
|
+
/**
|
|
2353
|
+
* The option to show the latest changes.
|
|
2354
|
+
*/
|
|
1958
2355
|
displayLatestChanges: {
|
|
1959
2356
|
type: Boolean,
|
|
1960
2357
|
default: false,
|
|
@@ -1973,6 +2370,9 @@ export default {
|
|
|
1973
2370
|
type: String,
|
|
1974
2371
|
default: 'https://mapcore-demo.org/current/flatmap/v3/',
|
|
1975
2372
|
},
|
|
2373
|
+
/**
|
|
2374
|
+
* Specify the endpoint of the SPARC API.
|
|
2375
|
+
*/
|
|
1976
2376
|
sparcAPI: {
|
|
1977
2377
|
type: String,
|
|
1978
2378
|
default: 'https://api.sparc.science/',
|
|
@@ -1989,7 +2389,8 @@ export default {
|
|
|
1989
2389
|
return {
|
|
1990
2390
|
flatmapAPI: this.flatmapAPI,
|
|
1991
2391
|
sparcAPI: this.sparcAPI,
|
|
1992
|
-
$annotator: this.annotator
|
|
2392
|
+
$annotator: this.annotator,
|
|
2393
|
+
getFeaturesAlert: () => this.featuresAlert,
|
|
1993
2394
|
}
|
|
1994
2395
|
},
|
|
1995
2396
|
data: function () {
|
|
@@ -2046,7 +2447,9 @@ export default {
|
|
|
2046
2447
|
tooltipEntry: createUnfilledTooltipData(),
|
|
2047
2448
|
connectivityTooltipVisible: false,
|
|
2048
2449
|
drawerOpen: false,
|
|
2049
|
-
|
|
2450
|
+
featuresAlert: undefined,
|
|
2451
|
+
flightPath3DRadio: false,
|
|
2452
|
+
displayFlightPathOption: false,
|
|
2050
2453
|
colourRadio: true,
|
|
2051
2454
|
outlinesRadio: true,
|
|
2052
2455
|
minimapResizeShow: false,
|
|
@@ -2056,10 +2459,10 @@ export default {
|
|
|
2056
2459
|
currentHover: '',
|
|
2057
2460
|
viewingMode: 'Exploration',
|
|
2058
2461
|
viewingModes: ['Annotation', 'Exploration', 'Network Discovery'],
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2462
|
+
drawnType: 'All tools',
|
|
2463
|
+
drawnTypes: ['All tools', 'Point', 'LineString', 'Polygon', 'None'],
|
|
2464
|
+
annotatedType: 'Everyone',
|
|
2465
|
+
annotatedTypes: ['Everyone', 'Me', 'Others'],
|
|
2063
2466
|
openMapRef: undefined,
|
|
2064
2467
|
backgroundIconRef: undefined,
|
|
2065
2468
|
annotator: undefined,
|
|
@@ -2071,14 +2474,20 @@ export default {
|
|
|
2071
2474
|
inDrawing: false,
|
|
2072
2475
|
relevanceDisplay: false,
|
|
2073
2476
|
relevanceEntry: {},
|
|
2074
|
-
drawnAnnotationFeatures: undefined, // Store all exist drawn
|
|
2477
|
+
drawnAnnotationFeatures: undefined, // Store all exist drawn features
|
|
2075
2478
|
doubleClickedFeature: false,
|
|
2076
2479
|
activeDrawMode: undefined,
|
|
2077
2480
|
drawModes: ['Delete', 'Edit'],
|
|
2481
|
+
dialogPosition: {
|
|
2482
|
+
offsetX: 0,
|
|
2483
|
+
offsetY: 0,
|
|
2484
|
+
x: undefined,
|
|
2485
|
+
y: undefined
|
|
2486
|
+
}
|
|
2078
2487
|
}
|
|
2079
2488
|
},
|
|
2080
2489
|
computed: {
|
|
2081
|
-
|
|
2490
|
+
relevance: function () {
|
|
2082
2491
|
return Object.keys(this.relevanceEntry).length > 0
|
|
2083
2492
|
}
|
|
2084
2493
|
},
|
|
@@ -2086,23 +2495,79 @@ export default {
|
|
|
2086
2495
|
entry: function () {
|
|
2087
2496
|
if (!this.state) this.createFlatmap()
|
|
2088
2497
|
},
|
|
2089
|
-
helpMode: function (
|
|
2090
|
-
|
|
2498
|
+
helpMode: function (newVal, oldVal) {
|
|
2499
|
+
if (newVal !== oldVal) {
|
|
2500
|
+
this.setHelpMode(val)
|
|
2501
|
+
}
|
|
2091
2502
|
},
|
|
2092
2503
|
state: {
|
|
2093
|
-
handler: function (state) {
|
|
2094
|
-
if (
|
|
2095
|
-
this.
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2504
|
+
handler: function (state, oldVal) {
|
|
2505
|
+
if (state !== oldVal) {
|
|
2506
|
+
if (this.mapManager) {
|
|
2507
|
+
this.setState(state)
|
|
2508
|
+
} else {
|
|
2509
|
+
//this component has not been mounted yet
|
|
2510
|
+
this.setStateRequired = true
|
|
2511
|
+
}
|
|
2099
2512
|
}
|
|
2100
2513
|
},
|
|
2101
2514
|
immediate: true,
|
|
2102
2515
|
deep: true,
|
|
2103
2516
|
},
|
|
2517
|
+
activeDrawTool: function () {
|
|
2518
|
+
this.drawIconCssHacks()
|
|
2519
|
+
},
|
|
2520
|
+
activeDrawMode: function () {
|
|
2521
|
+
this.drawIconCssHacks()
|
|
2522
|
+
},
|
|
2523
|
+
/**
|
|
2524
|
+
* hide dialog when relevanceEntry is empty
|
|
2525
|
+
*/
|
|
2526
|
+
relevance: function (value) {
|
|
2527
|
+
const relevanceIcon = this.$el.querySelector('.drawRelevance')
|
|
2528
|
+
if (!value) {
|
|
2529
|
+
this.relevanceDisplay = false
|
|
2530
|
+
relevanceIcon.classList.add('inactive')
|
|
2531
|
+
} else {
|
|
2532
|
+
relevanceIcon.classList.remove('inactive')
|
|
2533
|
+
}
|
|
2534
|
+
},
|
|
2535
|
+
/**
|
|
2536
|
+
* popup dialog via click icon
|
|
2537
|
+
*/
|
|
2538
|
+
relevanceDisplay: function (display) {
|
|
2539
|
+
const relevanceIcon = this.$el.querySelector('.drawRelevance')
|
|
2540
|
+
if (display) {
|
|
2541
|
+
relevanceIcon.classList.add('iconSelected')
|
|
2542
|
+
this.dialogCssHacks()
|
|
2543
|
+
} else {
|
|
2544
|
+
relevanceIcon.classList.remove('iconSelected')
|
|
2545
|
+
}
|
|
2546
|
+
this.drawIconCssHacks()
|
|
2547
|
+
},
|
|
2548
|
+
/**
|
|
2549
|
+
* Set dialog offset when flatmap annotator used
|
|
2550
|
+
*/
|
|
2551
|
+
dialogPosition: {
|
|
2552
|
+
handler: function () {
|
|
2553
|
+
const containerRect = this.$el.getBoundingClientRect()
|
|
2554
|
+
this.dialogPosition.offsetX = containerRect.x
|
|
2555
|
+
this.dialogPosition.offsetY = containerRect.y
|
|
2556
|
+
},
|
|
2557
|
+
deep: true,
|
|
2558
|
+
once: true,
|
|
2559
|
+
},
|
|
2104
2560
|
viewingMode: function (mode) {
|
|
2105
2561
|
if (mode === 'Annotation') {
|
|
2562
|
+
this.$el.querySelector('.maplibregl-canvas').addEventListener('click', (e) => {
|
|
2563
|
+
e.preventDefault();
|
|
2564
|
+
this.dialogPosition.x = e.clientX
|
|
2565
|
+
this.dialogPosition.y = e.clientY
|
|
2566
|
+
// use to fix the draw point pop up position issue
|
|
2567
|
+
if (this.activeDrawTool === 'Point') {
|
|
2568
|
+
this.dialogCssHacks()
|
|
2569
|
+
}
|
|
2570
|
+
}, false)
|
|
2106
2571
|
this.showAnnotator(true)
|
|
2107
2572
|
this.annotator.authenticate().then((userData) => {
|
|
2108
2573
|
if (userData.name && userData.email) {
|
|
@@ -2120,8 +2585,12 @@ export default {
|
|
|
2120
2585
|
this.closeTooltip()
|
|
2121
2586
|
}
|
|
2122
2587
|
}
|
|
2588
|
+
},
|
|
2589
|
+
created: function () {
|
|
2590
|
+
|
|
2123
2591
|
},
|
|
2124
2592
|
mounted: function () {
|
|
2593
|
+
|
|
2125
2594
|
this.openMapRef = shallowRef(this.$refs.openMapRef)
|
|
2126
2595
|
this.backgroundIconRef = shallowRef(this.$refs.backgroundIconRef)
|
|
2127
2596
|
this.tooltipWait = []
|
|
@@ -2227,6 +2696,8 @@ export default {
|
|
|
2227
2696
|
transition: all 1s ease;
|
|
2228
2697
|
&.open {
|
|
2229
2698
|
opacity: 1;
|
|
2699
|
+
position: relative;
|
|
2700
|
+
z-index: 2;
|
|
2230
2701
|
}
|
|
2231
2702
|
&.close {
|
|
2232
2703
|
opacity: 0;
|
|
@@ -2269,6 +2740,7 @@ export default {
|
|
|
2269
2740
|
}
|
|
2270
2741
|
|
|
2271
2742
|
:deep(.maplibregl-popup) {
|
|
2743
|
+
z-index: 10;
|
|
2272
2744
|
max-width: 300px !important;
|
|
2273
2745
|
}
|
|
2274
2746
|
|
|
@@ -2383,15 +2855,21 @@ export default {
|
|
|
2383
2855
|
}
|
|
2384
2856
|
}
|
|
2385
2857
|
|
|
2386
|
-
.drawPoint, .drawLineString, .drawPolygon,
|
|
2387
|
-
.
|
|
2388
|
-
|
|
2858
|
+
.drawPoint, .drawLineString, .drawPolygon,
|
|
2859
|
+
.drawDelete, .drawEdit, .drawRelevance,
|
|
2860
|
+
.zoomIn, .zoomOut, .fitWindow {
|
|
2861
|
+
padding: 4px;
|
|
2389
2862
|
}
|
|
2390
2863
|
|
|
2391
|
-
.
|
|
2864
|
+
.iconSelected {
|
|
2392
2865
|
color: var(--el-color-primary-light-5) !important;
|
|
2393
2866
|
}
|
|
2394
2867
|
|
|
2868
|
+
.inactive {
|
|
2869
|
+
color: #DDDDDD !important;
|
|
2870
|
+
cursor: not-allowed !important;
|
|
2871
|
+
}
|
|
2872
|
+
|
|
2395
2873
|
.yellow-star-legend {
|
|
2396
2874
|
width: 130px;
|
|
2397
2875
|
cursor: pointer;
|
|
@@ -2423,6 +2901,10 @@ export default {
|
|
|
2423
2901
|
}
|
|
2424
2902
|
}
|
|
2425
2903
|
|
|
2904
|
+
:deep(.background-popper.el-popover.el-popper.h-auto) {
|
|
2905
|
+
height: auto !important;
|
|
2906
|
+
}
|
|
2907
|
+
|
|
2426
2908
|
:deep(.open-map-popper.el-popover.el-popper) {
|
|
2427
2909
|
padding-top: 5px;
|
|
2428
2910
|
padding-bottom: 5px;
|
|
@@ -2598,8 +3080,13 @@ export default {
|
|
|
2598
3080
|
}
|
|
2599
3081
|
|
|
2600
3082
|
.bottom-draw-control {
|
|
3083
|
+
background-color: var(--el-color-primary-light-9);
|
|
3084
|
+
padding: 4px 4px 2px 4px;
|
|
3085
|
+
border-style: solid;
|
|
3086
|
+
border-color: var(--el-color-primary-light-5);
|
|
3087
|
+
border-radius: 1rem;
|
|
2601
3088
|
position: absolute;
|
|
2602
|
-
right:
|
|
3089
|
+
right: calc(50vw - 100px);;
|
|
2603
3090
|
bottom: 16px;
|
|
2604
3091
|
}
|
|
2605
3092
|
|
|
@@ -2793,34 +3280,10 @@ export default {
|
|
|
2793
3280
|
}
|
|
2794
3281
|
}
|
|
2795
3282
|
|
|
2796
|
-
|
|
2797
|
-
text-align: justify;
|
|
2798
|
-
border-radius: 4px;
|
|
2799
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
2800
|
-
pointer-events: auto;
|
|
2801
|
-
background: #fff;
|
|
2802
|
-
border: 1px solid $app-primary-color;
|
|
2803
|
-
display: flex;
|
|
2804
|
-
flex-direction: column;
|
|
3283
|
+
.relevance-dialog {
|
|
2805
3284
|
position: absolute;
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
}
|
|
2809
|
-
|
|
2810
|
-
:deep(.el-dialog__body, .el-dialog__header) {
|
|
2811
|
-
padding-top: 10px;
|
|
2812
|
-
padding-bottom: 10px;
|
|
2813
|
-
}
|
|
2814
|
-
|
|
2815
|
-
.dialog-title {
|
|
2816
|
-
font-size: 18px;
|
|
2817
|
-
font-weight: bold;
|
|
2818
|
-
color: rgb(131, 0, 191);
|
|
2819
|
-
}
|
|
2820
|
-
|
|
2821
|
-
:deep(.el-card) {
|
|
2822
|
-
--el-card-padding: 12px;
|
|
2823
|
-
border: 0;
|
|
3285
|
+
z-index: 10;
|
|
3286
|
+
cursor: move;
|
|
2824
3287
|
}
|
|
2825
3288
|
</style>
|
|
2826
3289
|
|