@abi-software/flatmapvuer 1.6.2-beta.4 → 1.6.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/flatmapvuer",
3
- "version": "1.6.2-beta.4",
3
+ "version": "1.6.2",
4
4
  "license": "Apache-2.0",
5
5
  "files": [
6
6
  "dist/*",
@@ -43,8 +43,8 @@
43
43
  "./src/*": "./src/*"
44
44
  },
45
45
  "dependencies": {
46
- "@abi-software/flatmap-viewer": "^3.2.8",
47
- "@abi-software/map-utilities": "^1.2.2-beta.3",
46
+ "@abi-software/flatmap-viewer": "^3.2.10",
47
+ "@abi-software/map-utilities": "^1.2.1",
48
48
  "@abi-software/sparc-annotation": "0.3.2",
49
49
  "@abi-software/svg-sprite": "^1.0.1",
50
50
  "@element-plus/icons-vue": "^2.3.1",
@@ -152,6 +152,7 @@ Please use `const` to assign meaningful names to them...
152
152
  class: '.maplibregl-canvas',
153
153
  }"
154
154
  :toolbarOptions="toolbarOptions"
155
+ :drawnType="drawnType"
155
156
  :activeDrawTool="activeDrawTool"
156
157
  :activeDrawMode="activeDrawMode"
157
158
  :newlyDrawnEntry="drawnCreatedEvent"
@@ -259,7 +260,7 @@ Please use `const` to assign meaningful names to them...
259
260
  <div
260
261
  class="pathway-location"
261
262
  :class="{ open: drawerOpen, close: !drawerOpen }"
262
- v-show="!disableUI && requiresDrawer"
263
+ v-show="!disableUI"
263
264
  >
264
265
  <div
265
266
  class="pathway-container"
@@ -269,27 +270,27 @@ Please use `const` to assign meaningful names to them...
269
270
  >
270
271
  <svg-legends v-if="!isFC" class="svg-legends-container" />
271
272
  <template v-if="showStarInLegend">
272
- <el-popover
273
- content="Location of the featured dataset"
274
- placement="right"
275
- :teleported="true"
276
- trigger="manual"
277
- width="max-content"
278
- :offset="-10"
279
- popper-class="flatmap-popper flatmap-teleport-popper"
280
- :visible="hoverVisibilities[9].value"
281
- ref="featuredMarkerPopover"
282
- >
283
- <template #reference>
284
- <div
285
- v-popover:featuredMarkerPopover
286
- class="yellow-star-legend"
287
- v-html="yellowstar"
288
- @mouseover="showTooltip(9)"
289
- @mouseout="hideTooltip(9)"
290
- ></div>
291
- </template>
292
- </el-popover>
273
+ <el-popover
274
+ content="Location of the featured dataset"
275
+ placement="right"
276
+ :teleported="true"
277
+ trigger="manual"
278
+ width="max-content"
279
+ :offset="-10"
280
+ popper-class="flatmap-popper flatmap-teleport-popper"
281
+ :visible="hoverVisibilities[9].value"
282
+ ref="featuredMarkerPopover"
283
+ >
284
+ <template #reference>
285
+ <div
286
+ v-popover:featuredMarkerPopover
287
+ class="yellow-star-legend"
288
+ v-html="yellowstar"
289
+ @mouseover="showTooltip(9)"
290
+ @mouseout="hideTooltip(9)"
291
+ ></div>
292
+ </template>
293
+ </el-popover>
293
294
  </template>
294
295
  <!-- The line below places the yellowstar svg on the left, and the text "Featured markers on the right" with css so they are both centered in the div -->
295
296
  <el-popover
@@ -453,22 +454,44 @@ Please use `const` to assign meaningful names to them...
453
454
  </template>
454
455
  </div>
455
456
  <el-row class="viewing-mode-description">
456
- {{ modeDescription }}
457
+ {{ viewingModes[viewingMode] }}
457
458
  </el-row>
458
459
  </el-row>
459
460
  <template v-if="viewingMode === 'Annotation' && userInformation">
460
- <el-row class="backgroundText">Annotations From</el-row>
461
+ <el-row class="backgroundText">Drawn By*</el-row>
462
+ <el-row class="backgroundControl">
463
+ <el-select
464
+ :teleported="false"
465
+ v-model="drawnType"
466
+ placeholder="Select"
467
+ class="select-box"
468
+ popper-class="flatmap_dropdown"
469
+ @change="setDrawnType"
470
+ >
471
+ <el-option
472
+ v-for="item in drawnTypes"
473
+ :key="item"
474
+ :label="item"
475
+ :value="item"
476
+ >
477
+ <el-row>
478
+ <el-col :span="12">{{ item }}</el-col>
479
+ </el-row>
480
+ </el-option>
481
+ </el-select>
482
+ </el-row>
483
+ <el-row class="backgroundText">Annotated By*</el-row>
461
484
  <el-row class="backgroundControl">
462
485
  <el-select
463
486
  :teleported="false"
464
- v-model="annotationFrom"
487
+ v-model="annotatedType"
465
488
  placeholder="Select"
466
489
  class="select-box"
467
490
  popper-class="flatmap_dropdown"
468
- @change="setAnnotationFrom"
491
+ @change="setAnnotatedType"
469
492
  >
470
493
  <el-option
471
- v-for="item in annotatedSource"
494
+ v-for="item in annotatedTypes"
472
495
  :key="item"
473
496
  :label="item"
474
497
  :value="item"
@@ -645,24 +668,20 @@ const centroid = (geometry) => {
645
668
  let featureGeometry = { lng: 0, lat: 0, }
646
669
  let coordinates
647
670
  if (geometry.type === "Polygon") {
648
- if (geometry.coordinates.length) {
649
- coordinates = geometry.coordinates[0]
650
- }
671
+ coordinates = geometry.coordinates[0]
651
672
  } else {
652
673
  coordinates = geometry.coordinates
653
674
  }
654
- if (coordinates) {
655
- if (!(geometry.type === 'Point')) {
656
- coordinates.map((coor) => {
657
- featureGeometry.lng += parseFloat(coor[0])
658
- featureGeometry.lat += parseFloat(coor[1])
659
- })
660
- featureGeometry.lng = featureGeometry.lng / coordinates.length
661
- featureGeometry.lat = featureGeometry.lat / coordinates.length
662
- } else {
663
- featureGeometry.lng += parseFloat(coordinates[0])
664
- featureGeometry.lat += parseFloat(coordinates[1])
665
- }
675
+ if (!(geometry.type === 'Point')) {
676
+ coordinates.map((coor) => {
677
+ featureGeometry.lng += parseFloat(coor[0])
678
+ featureGeometry.lat += parseFloat(coor[1])
679
+ })
680
+ featureGeometry.lng = featureGeometry.lng / coordinates.length
681
+ featureGeometry.lat = featureGeometry.lat / coordinates.length
682
+ } else {
683
+ featureGeometry.lng += parseFloat(coordinates[0])
684
+ featureGeometry.lat += parseFloat(coordinates[1])
666
685
  }
667
686
  return featureGeometry
668
687
  }
@@ -754,7 +773,6 @@ export default {
754
773
  if (this.annotationSidebar) this.$emit("annotation-close")
755
774
  this.closeTooltip()
756
775
  this.annotationEventCallback({}, { type: 'aborted' })
757
- this.initialiseDrawing()
758
776
  },
759
777
  /**
760
778
  * @public
@@ -830,19 +848,21 @@ export default {
830
848
  * @arg {String} `name`
831
849
  */
832
850
  toolbarEvent: function (type, name) {
833
- if (this.isValidDrawnCreated) return;
834
851
  this.manualAbortedOnClose()
835
852
  this.doubleClickedFeature = false
836
- // Deselect any feature when draw mode/tool is changed
837
- this.changeAnnotationDrawMode({ mode: 'simple_select' })
853
+ this.connectionEntry = {}
838
854
  if (type === 'mode') {
855
+ // Deselect any feature when draw mode is changed
856
+ this.changeAnnotationDrawMode({ mode: 'simple_select' })
839
857
  this.activeDrawMode = name
840
858
  } else if (type === 'tool') {
841
- // Remove any unsubmitted drawn
842
- this.cancelDrawnFeature()
843
859
  if (name) {
844
860
  const tool = name.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`)
845
861
  this.changeAnnotationDrawMode({ mode: `draw${tool}` })
862
+ this.initialiseDrawing()
863
+ } else {
864
+ this.changeAnnotationDrawMode({ mode: 'simple_select' })
865
+ this.cancelDrawnFeature()
846
866
  }
847
867
  this.activeDrawTool = name
848
868
  }
@@ -865,7 +885,8 @@ export default {
865
885
  }
866
886
  this.doubleClickedFeature = false
867
887
  }
868
- } else if (this.activeDrawMode === 'Delete') {
888
+ }
889
+ if (this.activeDrawMode === 'Delete') {
869
890
  this.changeAnnotationDrawMode({
870
891
  mode: 'simple_select',
871
892
  options: { featureIds: [data.feature.feature.id] }
@@ -951,12 +972,9 @@ export default {
951
972
  ) {
952
973
  this.featureAnnotationSubmitted = true
953
974
  this.mapImp.commitAnnotationEvent(this.annotationEntry)
954
- if (annotation.body.comment === "Position Updated") {
955
- this.annotationEntry.positionUpdated = false
956
- } else if (this.annotationEntry.type === 'deleted') {
975
+ if (this.annotationEntry.type === 'deleted') {
957
976
  if (this.annotationSidebar) this.$emit("annotation-close")
958
977
  this.closeTooltip()
959
- // Only delete need, keep the annotation tooltip/sidebar open if created/updated
960
978
  this.annotationEntry = {}
961
979
  }
962
980
  this.addAnnotationFeature()
@@ -997,6 +1015,12 @@ export default {
997
1015
  let drawnFeatures = await this.annotator.drawnFeatures(this.userToken, this.serverURL, annotatedItemIds)
998
1016
  // The annotator has `resource` and `features` fields
999
1017
  if ('resource' in drawnFeatures) drawnFeatures = drawnFeatures.features
1018
+ // Use to switch the displayed feature type
1019
+ if (this.drawnType !== 'All tools') {
1020
+ drawnFeatures = drawnFeatures.filter((feature) => {
1021
+ return feature.geometry.type === this.drawnType
1022
+ })
1023
+ }
1000
1024
  return drawnFeatures
1001
1025
  },
1002
1026
  /**
@@ -1005,22 +1029,22 @@ export default {
1005
1029
  */
1006
1030
  addAnnotationFeature: async function () {
1007
1031
  if (this.mapImp) {
1008
- if (!this.featureAnnotationSubmitted) {
1009
- this.clearAnnotationFeature()
1010
- this.loading = true
1011
- }
1012
- const userId = this.annotationFrom === 'Anyone' ?
1013
- undefined : this.userInformation.orcid ?
1014
- this.userInformation.orcid : '0000-0000-0000-0000'
1015
- const participated = this.annotationFrom === 'Anyone' ?
1016
- undefined : this.annotationFrom === 'Me' ?
1017
- true : false
1018
- const drawnFeatures = await this.fetchDrawnFeatures(userId, participated)
1019
- this.existDrawnFeatures = drawnFeatures
1020
- this.loading = false
1021
- if (!this.featureAnnotationSubmitted) {
1022
- for (const feature of drawnFeatures) {
1023
- this.mapImp.addAnnotationFeature(feature)
1032
+ if (!this.featureAnnotationSubmitted) this.clearAnnotationFeature()
1033
+ if (this.drawnType !== 'None') {
1034
+ if (!this.featureAnnotationSubmitted) this.loading = true
1035
+ const userId = this.annotatedType === 'Anyone' ?
1036
+ undefined : this.userInformation.orcid ?
1037
+ this.userInformation.orcid : '0000-0000-0000-0000'
1038
+ const participated = this.annotatedType === 'Anyone' ?
1039
+ undefined : this.annotatedType === 'Me' ?
1040
+ true : false
1041
+ const drawnFeatures = await this.fetchDrawnFeatures(userId, participated)
1042
+ this.existDrawnFeatures = drawnFeatures
1043
+ this.loading = false
1044
+ if (!this.featureAnnotationSubmitted) {
1045
+ for (const feature of drawnFeatures) {
1046
+ this.mapImp.addAnnotationFeature(feature)
1047
+ }
1024
1048
  }
1025
1049
  }
1026
1050
  }
@@ -1038,13 +1062,26 @@ export default {
1038
1062
  this.$el.querySelector('.maplibregl-ctrl-group').style.display = 'none'
1039
1063
  }
1040
1064
  },
1065
+ /**
1066
+ * @public
1067
+ * Function to switch the type of annotation.
1068
+ * @arg {Boolean} `flag`
1069
+ */
1070
+ setDrawnType: function (flag) {
1071
+ this.drawnType = flag
1072
+ if (this.mapImp) {
1073
+ this.manualAbortedOnClose()
1074
+ this.addAnnotationFeature()
1075
+ this.initialiseDrawing()
1076
+ }
1077
+ },
1041
1078
  /**
1042
1079
  * @public
1043
1080
  * Function to switch the type of person who annotated.
1044
1081
  * @arg {Boolean} `flag`
1045
1082
  */
1046
- setAnnotationFrom: function (flag) {
1047
- this.annotationFrom = flag
1083
+ setAnnotatedType: function (flag) {
1084
+ this.annotatedType = flag
1048
1085
  if (this.mapImp) {
1049
1086
  this.manualAbortedOnClose()
1050
1087
  this.addAnnotationFeature()
@@ -1552,7 +1589,7 @@ export default {
1552
1589
  this.annotationEntry = {}
1553
1590
  } else if (data.type === 'modeChanged') {
1554
1591
  if (data.feature.mode === 'direct_select') this.doubleClickedFeature = true
1555
- if (this.annotationSidebar && data.feature.mode === 'simple_select' && this.activeDrawMode === 'Deleted') {
1592
+ if (this.annotationSidebar && data.feature.mode === 'simple_select') {
1556
1593
  this.annotationEventCallback({}, { type: 'aborted' })
1557
1594
  }
1558
1595
  } else if (data.type === 'selectionChanged') {
@@ -1570,15 +1607,6 @@ export default {
1570
1607
  this.connectionEntry = drawnFeature.connection
1571
1608
  }
1572
1609
  this.annotationDrawModeEvent(payload)
1573
- } else {
1574
- if (this.annotationSidebar && this.previousEditEvent.type === 'updated') {
1575
- this.annotationEntry = {
1576
- ...this.previousEditEvent,
1577
- resourceId: this.serverURL
1578
- }
1579
- this.annotationEventCallback({}, { type: 'aborted' })
1580
- }
1581
- this.previousEditEvent = {}
1582
1610
  }
1583
1611
  }
1584
1612
  } else {
@@ -1596,7 +1624,6 @@ export default {
1596
1624
  if (data.type === 'created') this.drawnCreatedEvent = payload
1597
1625
  else this.checkAndCreatePopups(payload)
1598
1626
  }
1599
- if (data.type === 'updated') this.previousEditEvent = data
1600
1627
  if (data.type === 'deleted') this.previousDeletedEvent = data
1601
1628
  else this.previousDeletedEvent = {}
1602
1629
  },
@@ -1843,8 +1870,12 @@ export default {
1843
1870
  if (data.feature.featureId && data.feature.models) {
1844
1871
  this.displayTooltip(data.feature.models)
1845
1872
  } else if (data.feature.feature) {
1846
- // in drawing or edit/delete mode is on or valid drawn
1847
- if (this.activeDrawTool || this.activeDrawMode || this.isValidDrawnCreated) {
1873
+ // in drawing or edit/delete mode is on or has connectivity
1874
+ if (
1875
+ this.activeDrawTool ||
1876
+ this.activeDrawMode ||
1877
+ Object.keys(this.connectionEntry).length > 0
1878
+ ) {
1848
1879
  this.featureAnnotationSubmitted = false
1849
1880
  this.annotationEntry.featureId = data.feature.feature.id
1850
1881
  if (this.activeDrawTool) {
@@ -2011,11 +2042,7 @@ export default {
2011
2042
  isPathwayContainer(parentElement) ||
2012
2043
  isPathwayContainer(nextElementSibling)
2013
2044
  ) {
2014
- if (this.requiresDrawer) {
2015
- this.drawerOpen = true;
2016
- } else {
2017
- this.helpModeActiveIndex += 1;
2018
- }
2045
+ this.drawerOpen = true;
2019
2046
  }
2020
2047
  } else {
2021
2048
  // skip the unavailable tooltips
@@ -2147,7 +2174,8 @@ export default {
2147
2174
  !this.disableUI && (
2148
2175
  (
2149
2176
  this.viewingMode === 'Annotation' &&
2150
- !this.annotationSidebar
2177
+ !this.annotationSidebar &&
2178
+ this.userInformation
2151
2179
  ) ||
2152
2180
  (
2153
2181
  this.viewingMode === 'Exploration' &&
@@ -2161,6 +2189,7 @@ export default {
2161
2189
  this.mapImp.showPopup(featureId, this.$refs.tooltip.$el, options);
2162
2190
  this.popUpCssHacks();
2163
2191
  });
2192
+
2164
2193
  }
2165
2194
  },
2166
2195
  hasTooltipEntry: function () {
@@ -2454,7 +2483,7 @@ export default {
2454
2483
  }
2455
2484
  }
2456
2485
 
2457
- let promise1 = this.mapManagerRef.loadMap(
2486
+ let promise1 = this.mapManager.loadMap(
2458
2487
  identifier,
2459
2488
  this.$refs.display,
2460
2489
  this.eventCallback(),
@@ -2539,6 +2568,7 @@ export default {
2539
2568
  this.addResizeButtonToMinimap()
2540
2569
  this.loading = false
2541
2570
  this.computePathControlsMaximumHeight()
2571
+ this.drawerOpen = true;
2542
2572
  this.mapResize()
2543
2573
  this.handleMapClick();
2544
2574
  this.setInitMapState();
@@ -2801,14 +2831,6 @@ export default {
2801
2831
  type: Object,
2802
2832
  default: undefined,
2803
2833
  },
2804
- /**
2805
- * Flatmap's Map Manager to use as single Map Manager
2806
- * if the FlatmapVuer is loaded from MultiFlatmapVuer.
2807
- */
2808
- mapManager: {
2809
- type: Object,
2810
- default: undefined,
2811
- },
2812
2834
  /**
2813
2835
  * Specify the endpoint of the flatmap server.
2814
2836
  */
@@ -2856,7 +2878,7 @@ export default {
2856
2878
  data: function () {
2857
2879
  return {
2858
2880
  sensor: null,
2859
- mapManagerRef: undefined,
2881
+ mapManager: undefined,
2860
2882
  flatmapQueries: undefined,
2861
2883
  annotationEntry: {},
2862
2884
  //tooltip display has to be set to false until it is rendered
@@ -2920,10 +2942,12 @@ export default {
2920
2942
  viewingModes: {
2921
2943
  'Exploration': 'Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources',
2922
2944
  'Neuron Connection': 'Discover Neuron connections by selecting a neuron and viewing its associated network connections',
2923
- 'Annotation': ['View feature annotations', 'Add, comment on and view feature annotations']
2945
+ 'Annotation': 'View internal identifiers of features'
2924
2946
  },
2925
- annotationFrom: 'Anyone',
2926
- annotatedSource: ['Anyone', 'Me', 'Others'],
2947
+ drawnType: 'All tools',
2948
+ drawnTypes: ['All tools', 'Point', 'LineString', 'Polygon', 'None'],
2949
+ annotatedType: 'Anyone',
2950
+ annotatedTypes: ['Anyone', 'Me', 'Others'],
2927
2951
  openMapRef: undefined,
2928
2952
  backgroundIconRef: undefined,
2929
2953
  toolbarOptions: [
@@ -2940,7 +2964,6 @@ export default {
2940
2964
  activeDrawTool: undefined,
2941
2965
  featureAnnotationSubmitted: false,
2942
2966
  drawnCreatedEvent: {},
2943
- previousEditEvent: {},
2944
2967
  previousDeletedEvent: {},
2945
2968
  connectionEntry: {},
2946
2969
  existDrawnFeatures: [], // Store all exist drawn features
@@ -2975,37 +2998,6 @@ export default {
2975
2998
  isValidDrawnCreated: function () {
2976
2999
  return Object.keys(this.drawnCreatedEvent).length > 0
2977
3000
  },
2978
- requiresDrawer: function() {
2979
- if (this.loading) {
2980
- this.drawerOpen = false
2981
- return false
2982
- }
2983
- if (!this.isFC) {
2984
- this.drawerOpen = true
2985
- return true
2986
- } else {
2987
- if ((this.systems?.length > 0) ||
2988
- (this.containsAlert && this.alertOptions) ||
2989
- (this.pathways?.length > 0) ||
2990
- (this.taxonConnectivity?.length > 0)
2991
- ) {
2992
- this.drawerOpen = true
2993
- return true
2994
- }
2995
- }
2996
- this.drawerOpen = false
2997
- return true
2998
- },
2999
- modeDescription: function () {
3000
- let description = this.viewingModes[this.viewingMode]
3001
- if (this.viewingMode === 'Annotation') {
3002
- if (this.userInformation) {
3003
- return description[1]
3004
- }
3005
- return description[0]
3006
- }
3007
- return description
3008
- },
3009
3001
  },
3010
3002
  watch: {
3011
3003
  entry: function () {
@@ -3027,7 +3019,7 @@ export default {
3027
3019
  state: {
3028
3020
  handler: function (state, oldVal) {
3029
3021
  if (state !== oldVal) {
3030
- if (this.mapManagerRef) {
3022
+ if (this.mapManager) {
3031
3023
  this.setState(state)
3032
3024
  } else {
3033
3025
  //this component has not been mounted yet
@@ -3096,22 +3088,11 @@ export default {
3096
3088
  }
3097
3089
  }
3098
3090
  },
3099
- created: function () {
3100
- if (this.mapManager) {
3101
- this.mapManagerRef = this.mapManager;
3102
- } else {
3103
- this.mapManagerRef = markRaw(new flatmap.MapManager(this.flatmapAPI));
3104
- /**
3105
- * The event emitted after a new mapManager is loaded.
3106
- * This mapManager can be used to create new flatmaps.
3107
- */
3108
- this.$emit('mapmanager-loaded', this.mapManagerRef);
3109
- }
3110
- },
3111
3091
  mounted: function () {
3112
3092
  this.openMapRef = shallowRef(this.$refs.openMapRef)
3113
3093
  this.backgroundIconRef = shallowRef(this.$refs.backgroundIconRef)
3114
3094
  this.tooltipWait.length = this.hoverVisibilities.length
3095
+ this.mapManager = markRaw(new flatmap.MapManager(this.flatmapAPI))
3115
3096
  this.flatmapQueries = markRaw(new FlatmapQueries())
3116
3097
  this.flatmapQueries.initialise(this.flatmapAPI)
3117
3098
  if (this.state) {
@@ -3208,7 +3189,6 @@ export default {
3208
3189
 
3209
3190
  .svg-legends-container {
3210
3191
  width: 70%;
3211
- min-width:183px;
3212
3192
  height: auto;
3213
3193
  position: relative;
3214
3194
  max-height: 140px;
@@ -83,7 +83,6 @@
83
83
  :displayMinimap="displayMinimap"
84
84
  :showStarInLegend="showStarInLegend"
85
85
  style="height: 100%"
86
- :mapManager="mapManagerRef"
87
86
  :flatmapAPI="flatmapAPI"
88
87
  :sparcAPI="sparcAPI"
89
88
  />
@@ -125,9 +124,6 @@ export default {
125
124
  Popover,
126
125
  FlatmapVuer,
127
126
  },
128
- created: function () {
129
- this.loadMapManager();
130
- },
131
127
  mounted: function () {
132
128
  this.initialise()
133
129
  EventBus.on('onActionClick', (action) => {
@@ -223,23 +219,6 @@ export default {
223
219
  }
224
220
  })
225
221
  },
226
- /**
227
- * Function to load `mapManager` to create flatmap.
228
- */
229
- loadMapManager: function () {
230
- if (!this.mapManagerRef) {
231
- if (this.mapManager) {
232
- this.mapManagerRef = this.mapManager;
233
- } else {
234
- this.mapManagerRef = markRaw(new flatmap.MapManager(this.flatmapAPI));
235
- /**
236
- * The event emitted after a new mapManager is loaded.
237
- * This mapManager can be used to create new flatmaps.
238
- */
239
- this.$emit('mapmanager-loaded', this.mapManagerRef);
240
- }
241
- }
242
- },
243
222
  /**
244
223
  * @public
245
224
  * Function to emit ``resource-selected`` event with provided ``resource``.
@@ -431,11 +410,12 @@ export default {
431
410
  //uuid is in the state but should be checked if it is the latest map
432
411
  //for that taxon
433
412
  return new Promise(() => {
413
+ const mapManager = new flatmap.MapManager(this.flatmapAPI)
434
414
  //mapManager.findMap_ is an async function so we need to wrap this with a promise
435
415
  const identifier = { taxon: mapState.entry }
436
416
  if (mapState.biologicalSex)
437
417
  identifier['biologicalSex'] = mapState.biologicalSex
438
- this.mapManagerRef
418
+ mapManager
439
419
  .findMap_(identifier)
440
420
  .then((map) => {
441
421
  if (map.uuid !== mapState.uuid) {
@@ -481,9 +461,6 @@ export default {
481
461
  */
482
462
  setState: function (state) {
483
463
  if (state) {
484
- // Update undefined mapManagerRef for setState happens before created event
485
- this.loadMapManager();
486
-
487
464
  //Update state if required
488
465
  this.updateState(state).then((currentState) => {
489
466
  this.initialise().then(() => {
@@ -719,14 +696,6 @@ export default {
719
696
  type: Object,
720
697
  default: undefined,
721
698
  },
722
- /**
723
- * Flatmap's Map Manager to use as single Map Manager
724
- * when the value is provided.
725
- */
726
- mapManager: {
727
- type: Object,
728
- default: undefined,
729
- },
730
699
  /**
731
700
  * Specify the endpoint of the flatmap server.
732
701
  */
@@ -770,7 +739,6 @@ export default {
770
739
  requireInitialisation: true,
771
740
  resolveList: markRaw([]),
772
741
  initialised: false,
773
- mapManagerRef: undefined,
774
742
  }
775
743
  },
776
744
  watch: {