@abi-software/mapintegratedvuer 1.1.0 → 1.2.0-beta.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/dist/{ContentMixin-Belbk7R9.js → ContentMixin-Chn7-LkR.js} +4 -5
- package/dist/{Flatmap-BEStr9DR.js → Flatmap-BYa1gZkN.js} +23 -23
- package/dist/{Iframe-CNeqS04g.js → Iframe-D4Wz_j32.js} +2 -2
- package/dist/{MultiFlatmap-CFF8nyw2.js → MultiFlatmap-C7LuHtEN.js} +25 -25
- package/dist/{Plot-BpS4tvSe.js → Plot-CI9rJRr9.js} +2 -2
- package/dist/{Scaffold-BXY9_HO6.js → Scaffold-J3mYovrG.js} +97 -97
- package/dist/{Simulation-Di2xaBxJ.js → Simulation-B1pfz5o9.js} +2 -2
- package/dist/{flatmapvuer-C67b_5lI.js → flatmapvuer-C31TbLvT.js} +39098 -34618
- package/dist/{index-CpppckRD.js → index-CB15HPC-.js} +11641 -11803
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +514 -567
- package/dist/style-8EUTEKFl.js +51 -0
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/src/components/ContentVuer.vue +10 -10
- package/src/components/SplitFlow.vue +14 -8
- package/src/components/viewers/Flatmap.vue +42 -35
- package/src/components/viewers/MultiFlatmap.vue +53 -50
- package/src/components/viewers/Scaffold.vue +43 -36
- package/src/mixins/ContentMixin.js +2 -2
- package/src/mixins/DynamicMarkerMixin.js +28 -45
- package/dist/style-CdEDV2B6.js +0 -62
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@abi-software/mapintegratedvuer",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.2.0-beta.0",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"scripts": {
|
6
6
|
"serve": "vite --host --force",
|
@@ -48,8 +48,8 @@
|
|
48
48
|
"*.js"
|
49
49
|
],
|
50
50
|
"dependencies": {
|
51
|
-
"@abi-software/flatmapvuer": "^1.1.
|
52
|
-
"@abi-software/map-side-bar": "^2.2.
|
51
|
+
"@abi-software/flatmapvuer": "^1.1.2-alpha",
|
52
|
+
"@abi-software/map-side-bar": "^2.2.1-alpha-1",
|
53
53
|
"@abi-software/plotvuer": "1.0.0",
|
54
54
|
"@abi-software/scaffoldvuer": "^1.1.0",
|
55
55
|
"@abi-software/simulationvuer": "1.0.0",
|
@@ -79,19 +79,19 @@ export default {
|
|
79
79
|
},
|
80
80
|
methods: {
|
81
81
|
flatmapProvenacneReady: function(prov) {
|
82
|
-
this.$refs.contentBar
|
82
|
+
this.$refs.contentBar?.setupFlatmapContextCard(prov);
|
83
83
|
},
|
84
84
|
/**
|
85
85
|
* Toggle sync mode on/off depending on species and current state
|
86
86
|
*/
|
87
87
|
toggleSyncMode: function () {
|
88
|
-
this.$refs.viewer
|
88
|
+
this.$refs.viewer?.toggleSyncMode();
|
89
89
|
},
|
90
90
|
getId: function () {
|
91
91
|
return this.entry.id;
|
92
92
|
},
|
93
93
|
getState: function () {
|
94
|
-
return this.$refs.viewer
|
94
|
+
return this.$refs.viewer?.getState();
|
95
95
|
},
|
96
96
|
resourceSelected: function (payload) {
|
97
97
|
this.$emit("resource-selected", payload);
|
@@ -101,32 +101,32 @@ export default {
|
|
101
101
|
this.entriesStore.updateViewForEntry({id: this.entry.id, viewUrl});
|
102
102
|
} else {
|
103
103
|
//Manually set it as it cannot be set with reactivity
|
104
|
-
this.$refs.viewer
|
104
|
+
this.$refs.viewer?.updateWithViewUrl(viewUrl);
|
105
105
|
}
|
106
106
|
},
|
107
107
|
/**
|
108
108
|
* Perform a local search on this contentvuer
|
109
109
|
*/
|
110
110
|
search: function (term) {
|
111
|
-
return this.$refs.viewer
|
111
|
+
return this.$refs.viewer?.search(term);
|
112
112
|
},
|
113
113
|
/**
|
114
114
|
* Push the suggested terms into the suggestions array
|
115
115
|
*/
|
116
116
|
searchSuggestions: function(term, suggestions) {
|
117
|
-
this.$refs.viewer
|
117
|
+
this.$refs.viewer?.searchSuggestions(term, suggestions);
|
118
118
|
},
|
119
119
|
setPanesBoundary: function() {
|
120
|
-
this.$refs.contentBar
|
120
|
+
this.$refs.contentBar?.setBoundary(this.$refs["container"][0]);
|
121
121
|
},
|
122
122
|
speciesChanged: function (species) {
|
123
123
|
this.activeSpecies = species;
|
124
124
|
},
|
125
125
|
receiveSynchronisedEvent: async function (data) {
|
126
|
-
this.$refs.viewer
|
126
|
+
this.$refs.viewer?.receiveSynchronisedEvent(data);
|
127
127
|
},
|
128
128
|
requestSynchronisedEvent: function (flag) {
|
129
|
-
this.$refs.viewer
|
129
|
+
this.$refs.viewer?.requestSynchronisedEvent(flag);
|
130
130
|
},
|
131
131
|
/**
|
132
132
|
* Check if this viewer is currently visible
|
@@ -136,7 +136,7 @@ export default {
|
|
136
136
|
return paneName !== undefined;
|
137
137
|
},
|
138
138
|
onResize: function () {
|
139
|
-
this.$refs.viewer
|
139
|
+
this.$refs.viewer?.onResize();
|
140
140
|
},
|
141
141
|
},
|
142
142
|
data: function () {
|
@@ -28,6 +28,7 @@
|
|
28
28
|
@actionClick="actionClick"
|
29
29
|
@tabClicked="tabClicked"
|
30
30
|
@search-changed="searchChanged($event)"
|
31
|
+
@anatomy-in-datasets="updateMarkers($event)"
|
31
32
|
@hover-changed="hoverChanged($event)"
|
32
33
|
@contextUpdate="contextUpdate($event)"
|
33
34
|
@datalink-clicked="datalinkClicked($event)"
|
@@ -93,6 +94,7 @@ export default {
|
|
93
94
|
startUp: true,
|
94
95
|
search: '',
|
95
96
|
activeDockedId : 1,
|
97
|
+
hoveredMarkerDelay: undefined,
|
96
98
|
filterTriggered: false,
|
97
99
|
availableFacets: [],
|
98
100
|
}
|
@@ -257,7 +259,14 @@ export default {
|
|
257
259
|
hoverChanged: function (data) {
|
258
260
|
const hoverEntries = data && data.anatomy ? data.anatomy : []
|
259
261
|
this.settingsStore.updateHoveredMarkers(hoverEntries);
|
260
|
-
|
262
|
+
if (!hoverEntries.length) {
|
263
|
+
this.hoveredMarkerDelay = setTimeout(() => {
|
264
|
+
EventBus.emit("markerUpdate");
|
265
|
+
}, 3000)
|
266
|
+
} else {
|
267
|
+
clearTimeout(this.hoveredMarkerDelay)
|
268
|
+
EventBus.emit("markerUpdate");
|
269
|
+
}
|
261
270
|
},
|
262
271
|
searchChanged: function (data) {
|
263
272
|
if (data && data.type == "query-update") {
|
@@ -296,13 +305,10 @@ export default {
|
|
296
305
|
}
|
297
306
|
this.filterTriggered = false; // reset for next action
|
298
307
|
}
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
this.availableFacets = data.value.labels
|
305
|
-
}
|
308
|
+
},
|
309
|
+
updateMarkers: function (data) {
|
310
|
+
this.settingsStore.updateMarkers(data);
|
311
|
+
EventBus.emit("markerUpdate");
|
306
312
|
},
|
307
313
|
getNewEntryId: function() {
|
308
314
|
if (this.entries.length) {
|
@@ -1,39 +1,41 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
2
|
+
<div class="viewer-container">
|
3
|
+
<FlatmapVuer
|
4
|
+
:state="entry.state"
|
5
|
+
:entry="entry.resource"
|
6
|
+
@resource-selected="flatmaprResourceSelected(entry.type, $event)"
|
7
|
+
@pan-zoom-callback="flatmapPanZoomCallback"
|
8
|
+
:name="entry.resource"
|
9
|
+
style="height: 100%; width: 100%"
|
10
|
+
:minZoom="entry.minZoom"
|
11
|
+
:helpMode="helpMode"
|
12
|
+
:helpModeActiveItem="helpModeActiveItem"
|
13
|
+
:helpModeInitialIndex="-1"
|
14
|
+
:helpModeDialog="useHelpModeDialog"
|
15
|
+
@help-mode-last-item="onHelpModeLastItem"
|
16
|
+
@shown-tooltip="onTooltipShown"
|
17
|
+
@shown-map-tooltip="onMapTooltipShown"
|
18
|
+
:pathControls="true"
|
19
|
+
ref="flatmap"
|
20
|
+
@ready="flatmapReadyCall"
|
21
|
+
:displayMinimap="false"
|
22
|
+
:displayWarning="true"
|
23
|
+
:enableOpenMapUI="true"
|
24
|
+
:flatmapAPI="flatmapAPI"
|
25
|
+
:sparcAPI="apiLocation"
|
26
|
+
@open-map="openMap"
|
27
|
+
@pathway-selection-changed="onPathwaySelectionChanged"
|
28
|
+
/>
|
28
29
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
30
|
+
<HelpModeDialog
|
31
|
+
v-if="helpMode && useHelpModeDialog"
|
32
|
+
ref="flatmapHelp"
|
33
|
+
:flatmapRef="flatmapRef"
|
34
|
+
:lastItem="helpModeLastItem"
|
35
|
+
@show-next="onHelpModeShowNext"
|
36
|
+
@finish-help-mode="onFinishHelpMode"
|
37
|
+
/>
|
38
|
+
</div>
|
37
39
|
</template>
|
38
40
|
|
39
41
|
<script>
|
@@ -160,7 +162,7 @@ export default {
|
|
160
162
|
mounted: function() {
|
161
163
|
this.getAvailableTerms();
|
162
164
|
EventBus.on("markerUpdate", () => {
|
163
|
-
this.
|
165
|
+
this.flatmapMarkerUpdate(undefined);
|
164
166
|
});
|
165
167
|
},
|
166
168
|
};
|
@@ -168,6 +170,11 @@ export default {
|
|
168
170
|
|
169
171
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
170
172
|
<style scoped lang="scss">
|
173
|
+
.viewer-container {
|
174
|
+
width: 100%;
|
175
|
+
height: 100%;
|
176
|
+
}
|
177
|
+
|
171
178
|
:deep(.maplibregl-popup) {
|
172
179
|
z-index: 3;
|
173
180
|
}
|
@@ -1,40 +1,42 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
2
|
+
<div class="viewer-container">
|
3
|
+
<MultiFlatmapVuer
|
4
|
+
:availableSpecies="availableSpecies"
|
5
|
+
@flatmapChanged="flatmapChanged"
|
6
|
+
@ready="multiFlatmapReady"
|
7
|
+
:state="entry.state"
|
8
|
+
@resource-selected="flatmaprResourceSelected(entry.type, $event)"
|
9
|
+
style="height: 100%; width: 100%"
|
10
|
+
:initial="entry.resource"
|
11
|
+
:helpMode="helpMode"
|
12
|
+
:helpModeActiveItem="helpModeActiveItem"
|
13
|
+
:helpModeDialog="useHelpModeDialog"
|
14
|
+
@help-mode-last-item="onHelpModeLastItem"
|
15
|
+
@shown-tooltip="onTooltipShown"
|
16
|
+
@shown-map-tooltip="onMapTooltipShown"
|
17
|
+
ref="multiflatmap"
|
18
|
+
:displayMinimap="true"
|
19
|
+
:showStarInLegend="showStarInLegend"
|
20
|
+
:enableOpenMapUI="true"
|
21
|
+
:openMapOptions="openMapOptions"
|
22
|
+
:flatmapAPI="flatmapAPI"
|
23
|
+
:sparcAPI="apiLocation"
|
24
|
+
@pan-zoom-callback="flatmapPanZoomCallback"
|
25
|
+
@open-map="openMap"
|
26
|
+
@finish-help-mode="endHelp"
|
27
|
+
@pathway-selection-changed="onPathwaySelectionChanged"
|
28
|
+
@open-pubmed-url="onOpenPubmedUrl"
|
29
|
+
/>
|
29
30
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
31
|
+
<HelpModeDialog
|
32
|
+
v-if="helpMode && useHelpModeDialog"
|
33
|
+
ref="multiflatmapHelp"
|
34
|
+
:multiflatmapRef="multiflatmapRef"
|
35
|
+
:lastItem="helpModeLastItem"
|
36
|
+
@show-next="onHelpModeShowNext"
|
37
|
+
@finish-help-mode="onFinishHelpMode"
|
38
|
+
/>
|
39
|
+
</div>
|
38
40
|
</template>
|
39
41
|
|
40
42
|
<script>
|
@@ -153,7 +155,6 @@ export default {
|
|
153
155
|
payload: payload,
|
154
156
|
type: this.entry.type,
|
155
157
|
};
|
156
|
-
this.flatmapMarkerZoomUpdate(false, undefined);
|
157
158
|
this.$emit("resource-selected", result);
|
158
159
|
}
|
159
160
|
},
|
@@ -243,7 +244,6 @@ export default {
|
|
243
244
|
this.$refs.multiflatmap
|
244
245
|
.getCurrentFlatmap()
|
245
246
|
.mapImp.panZoomTo(origin, [sW, sH]);
|
246
|
-
this.flatmapMarkerZoomUpdate(false, undefined);
|
247
247
|
}
|
248
248
|
}
|
249
249
|
},
|
@@ -320,7 +320,7 @@ export default {
|
|
320
320
|
flatmap.enablePanZoomEvents(true); // Use zoom events for dynamic markers
|
321
321
|
this.flatmapReady = true;
|
322
322
|
const flatmapImp = flatmap.mapImp;
|
323
|
-
this.
|
323
|
+
this.flatmapMarkerUpdate(flatmapImp);
|
324
324
|
this.updateProvCard();
|
325
325
|
}
|
326
326
|
},
|
@@ -344,9 +344,9 @@ export default {
|
|
344
344
|
restoreFeaturedMarkers: function (flatmap) {
|
345
345
|
this.settingsStore.resetFeaturedMarkerIdentifier();
|
346
346
|
const markers = this.settingsStore.featuredMarkers;
|
347
|
-
this.
|
347
|
+
this.updateFeaturedMarkers(markers, flatmap);
|
348
348
|
},
|
349
|
-
|
349
|
+
updateFeaturedMarkers: function (markers, flatmap) {
|
350
350
|
this.showStarInLegend = false; // will show if we have a featured marker
|
351
351
|
for (let index = 0; index < markers.length; ++index) {
|
352
352
|
if (markers[index]) {
|
@@ -413,7 +413,7 @@ export default {
|
|
413
413
|
return;
|
414
414
|
}
|
415
415
|
|
416
|
-
this.
|
416
|
+
this.updateFeaturedMarkers(markers, undefined);
|
417
417
|
},
|
418
418
|
},
|
419
419
|
mounted: function () {
|
@@ -421,7 +421,7 @@ export default {
|
|
421
421
|
this.getFeaturedDatasets();
|
422
422
|
|
423
423
|
EventBus.on("markerUpdate", () => {
|
424
|
-
this.
|
424
|
+
this.flatmapMarkerUpdate(this.$refs.multiflatmap.getCurrentFlatmap().mapImp);
|
425
425
|
});
|
426
426
|
},
|
427
427
|
};
|
@@ -430,6 +430,11 @@ export default {
|
|
430
430
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
431
431
|
<style scoped lang="scss">
|
432
432
|
|
433
|
+
.viewer-container {
|
434
|
+
width: 100%;
|
435
|
+
height: 100%;
|
436
|
+
}
|
437
|
+
|
433
438
|
:deep(.maplibregl-popup) {
|
434
439
|
z-index: 3;
|
435
440
|
}
|
@@ -439,6 +444,12 @@ export default {
|
|
439
444
|
cursor: pointer !important;
|
440
445
|
z-index: 2;
|
441
446
|
}
|
447
|
+
&.hovered {
|
448
|
+
div {
|
449
|
+
scale: 2;
|
450
|
+
transform: translate(0px, -5px);
|
451
|
+
}
|
452
|
+
}
|
442
453
|
&.highlight-marker {
|
443
454
|
visibility: visible !important;
|
444
455
|
cursor: pointer !important;
|
@@ -448,14 +459,6 @@ export default {
|
|
448
459
|
transform: translate(45px, -7px);
|
449
460
|
}
|
450
461
|
}
|
451
|
-
&.hovered-marker {
|
452
|
-
cursor: pointer !important;
|
453
|
-
z-index: 2;
|
454
|
-
div {
|
455
|
-
scale: 2;
|
456
|
-
transform: translate(0px, -5px);
|
457
|
-
}
|
458
|
-
}
|
459
462
|
}
|
460
463
|
|
461
464
|
</style>
|
@@ -1,41 +1,43 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
2
|
+
<div class="viewer-container">
|
3
|
+
<ScaffoldVuer
|
4
|
+
:state="entry.state"
|
5
|
+
:url="entry.resource"
|
6
|
+
:region="entry.region"
|
7
|
+
@scaffold-selected="resourceSelected(entry.type, $event, true)"
|
8
|
+
@scaffold-highlighted="scaffoldHighlighted(entry.type, $event)"
|
9
|
+
@scaffold-navigated="scaffoldNavigated(entry.type, $event)"
|
10
|
+
@on-ready="scaffoldIsReady"
|
11
|
+
@open-map="openMap"
|
12
|
+
ref="scaffold"
|
13
|
+
:background-toggle="true"
|
14
|
+
:traditional="true"
|
15
|
+
:helpMode="helpMode"
|
16
|
+
:helpModeActiveItem="helpModeActiveItem"
|
17
|
+
:helpModeDialog="useHelpModeDialog"
|
18
|
+
@help-mode-last-item="onHelpModeLastItem"
|
19
|
+
@shown-tooltip="onTooltipShown"
|
20
|
+
@shown-map-tooltip="onMapTooltipShown"
|
21
|
+
:render="visible"
|
22
|
+
:display-latest-message="true"
|
23
|
+
:warning-message="warningMessage"
|
24
|
+
:display-minimap="false"
|
25
|
+
:display-markers="false"
|
26
|
+
:enableOpenMapUI="true"
|
27
|
+
:view-u-r-l="entry.viewUrl"
|
28
|
+
:markerLabels="markerLabels"
|
29
|
+
:flatmapAPI="flatmapAPI"
|
30
|
+
/>
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
32
|
+
<HelpModeDialog
|
33
|
+
v-if="helpMode && useHelpModeDialog"
|
34
|
+
ref="scaffoldHelp"
|
35
|
+
:scaffoldRef="scaffoldRef"
|
36
|
+
:lastItem="helpModeLastItem"
|
37
|
+
@show-next="onHelpModeShowNext"
|
38
|
+
@finish-help-mode="onFinishHelpMode"
|
39
|
+
/>
|
40
|
+
</div>
|
39
41
|
</template>
|
40
42
|
|
41
43
|
<script>
|
@@ -206,6 +208,11 @@ export default {
|
|
206
208
|
</script>
|
207
209
|
|
208
210
|
<style scoped lang="scss">
|
211
|
+
.viewer-container {
|
212
|
+
width: 100%;
|
213
|
+
height: 100%;
|
214
|
+
}
|
215
|
+
|
209
216
|
:deep(.message-popper) {
|
210
217
|
white-space: unset;
|
211
218
|
max-width: 200px;
|
@@ -300,7 +300,7 @@ export default {
|
|
300
300
|
} catch (error) {
|
301
301
|
markerSpecies = undefined;
|
302
302
|
}
|
303
|
-
this.
|
303
|
+
this.updateFeaturedMarkers([markerCurie], undefined)
|
304
304
|
this.settingsStore.updateFeaturedMarker({
|
305
305
|
identifier,
|
306
306
|
marker: markerCurie,
|
@@ -412,7 +412,7 @@ export default {
|
|
412
412
|
});
|
413
413
|
}
|
414
414
|
},
|
415
|
-
|
415
|
+
flatmapMarkerUpdate() {
|
416
416
|
return;
|
417
417
|
},
|
418
418
|
onResize: function () {
|
@@ -4,36 +4,13 @@ import { mapStores } from 'pinia';
|
|
4
4
|
import { useSettingsStore } from '../stores/settings';
|
5
5
|
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
markers.forEach(id => {
|
15
|
-
let foundInArray = false;
|
16
|
-
// First check if uberon is in the list, check for zoom level
|
17
|
-
// if true. Note: markerZoomLevels is imported.
|
18
|
-
for (let i = 0; i < markerZoomLevels.length; i++) {
|
19
|
-
if (markerZoomLevels[i].id === id) {
|
20
|
-
foundInArray = true;
|
21
|
-
if (zoomLevel >= markerZoomLevels[i].showAtZoom) {
|
22
|
-
let markerClass = "standard-marker"
|
23
|
-
if (hoveredMarkers.includes(id)) markerClass = "hovered-marker"
|
24
|
-
flatmapImp.addMarker(id, { className: markerClass, cluster: false});
|
25
|
-
}
|
26
|
-
break;
|
27
|
-
}
|
28
|
-
}
|
29
|
-
// Did not match, add it regardless so we do not lose any
|
30
|
-
// markers.
|
31
|
-
if (!foundInArray) {
|
32
|
-
flatmapImp.addMarker(id, {className: "standard-marker", cluster: false});
|
33
|
-
}
|
34
|
-
});
|
35
|
-
}
|
36
|
-
};
|
7
|
+
// remove duplicates by stringifying the objects
|
8
|
+
const removeDuplicates = function (arrayOfAnything) {
|
9
|
+
if (!arrayOfAnything) return []
|
10
|
+
return [...new Set(arrayOfAnything.map((e) => JSON.stringify(e)))].map((e) =>
|
11
|
+
JSON.parse(e)
|
12
|
+
)
|
13
|
+
}
|
37
14
|
|
38
15
|
/* eslint-disable no-alert, no-console */
|
39
16
|
export default {
|
@@ -49,16 +26,14 @@ export default {
|
|
49
26
|
payload: payload,
|
50
27
|
type: this.entry.type,
|
51
28
|
};
|
52
|
-
this.flatmapMarkerZoomUpdate(false, undefined);
|
53
29
|
this.$emit("resource-selected", result);
|
54
30
|
}
|
55
31
|
},
|
56
32
|
/**
|
57
33
|
* Function used for updating the flatmap markers.
|
58
|
-
*
|
59
|
-
* the force flag is true.
|
34
|
+
* We set the markers based on what was searched and the flatmap clusters them.
|
60
35
|
*/
|
61
|
-
|
36
|
+
flatmapMarkerUpdate(flatmap) {
|
62
37
|
if (!this.flatmapReady) return;
|
63
38
|
|
64
39
|
let flatmapImp = flatmap;
|
@@ -66,16 +41,24 @@ export default {
|
|
66
41
|
flatmapImp = this.getFlatmapImp();
|
67
42
|
|
68
43
|
if (flatmapImp) {
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
44
|
+
// Set the dataset markers
|
45
|
+
let markers = this.settingsStore.markers;
|
46
|
+
markers = removeDuplicates(markers);
|
47
|
+
flatmapImp.clearMarkers();
|
48
|
+
flatmapImp.addDatasetMarkers(markers);
|
49
|
+
|
50
|
+
// Set the hovered markers
|
51
|
+
let hoveredMarkers = this.settingsStore.hoveredMarkers
|
52
|
+
hoveredMarkers = removeDuplicates(hoveredMarkers);
|
53
|
+
hoveredMarkers.forEach(id => {
|
54
|
+
let markerClass = "standard-marker" + " hovered" // Space-separated CSS class names
|
55
|
+
let markerCluster = false // Disable cluster when related dataset is hovered
|
56
|
+
flatmapImp.addMarker(id, { className: markerClass, cluster: markerCluster })
|
57
|
+
})
|
58
|
+
|
59
|
+
// Set the featured markers
|
60
|
+
if (this.entry.type === "MultiFlatmap") {
|
61
|
+
this.restoreFeaturedMarkers(flatmapImp);
|
79
62
|
}
|
80
63
|
}
|
81
64
|
},
|
@@ -84,7 +67,7 @@ export default {
|
|
84
67
|
flatmap.enablePanZoomEvents(true); // Use zoom events for dynamic markers
|
85
68
|
this.flatmapReady = true;
|
86
69
|
const flatmapImp = flatmap.mapImp;
|
87
|
-
this.
|
70
|
+
this.flatmapMarkerUpdate(flatmapImp);
|
88
71
|
}
|
89
72
|
},
|
90
73
|
}
|