Skip to content

Commit

Permalink
Merge pull request #261 from akhuoa/task/1387269083
Browse files Browse the repository at this point in the history
Use single mapManager for flatmapvuer and multiflatmapvuer
  • Loading branch information
alan-wu authored Nov 27, 2024
2 parents 4dda751 + 817e0cb commit d38f1ca
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/viewers/Flatmap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<FlatmapVuer
:state="entry.state"
:entry="entry.resource"
:mapManager="mapManager"
@resource-selected="flatmaprResourceSelected(entry.type, $event)"
@pan-zoom-callback="flatmapPanZoomCallback"
:name="entry.resource"
Expand Down Expand Up @@ -32,6 +33,7 @@
:sparcAPI="apiLocation"
@open-map="openMap"
@pathway-selection-changed="onPathwaySelectionChanged"
@mapmanager-loaded="onMapmanagerLoaded"
/>

<HelpModeDialog
Expand Down
2 changes: 2 additions & 0 deletions src/components/viewers/MultiFlatmap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@flatmapChanged="flatmapChanged"
@ready="multiFlatmapReady"
:state="entry.state"
:mapManager="mapManager"
@resource-selected="flatmaprResourceSelected(entry.type, $event)"
style="height: 100%; width: 100%"
:initial="entry.resource"
Expand Down Expand Up @@ -33,6 +34,7 @@
@finish-help-mode="endHelp"
@pathway-selection-changed="onPathwaySelectionChanged"
@open-pubmed-url="onOpenPubmedUrl"
@mapmanager-loaded="onMapmanagerLoaded"
/>

<HelpModeDialog
Expand Down
7 changes: 7 additions & 0 deletions src/mixins/ContentMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ export default {

this.onConnectivityInfoClose();
},
onMapmanagerLoaded: function (mapManager) {
this.settingsStore.updateMapManager(mapManager);
},
trackOpenMap: function (category) {
// GA Tagging
// Open map tracking
Expand Down Expand Up @@ -525,6 +528,7 @@ export default {
scaffoldLoaded: false,
isInHelp: false,
hoverDelay: undefined,
mapManager: undefined,
};
},
created: function () {
Expand All @@ -534,6 +538,9 @@ export default {
this.flatmapAPI = this.settingsStore.flatmapAPI;
if (this.settingsStore.sparcApi)
this.apiLocation = this.settingsStore.sparcApi;
if (this.settingsStore.mapManager) {
this.mapManager = this.settingsStore.mapManager;
}
},
watch: {
helpMode: function (newVal) {
Expand Down
4 changes: 4 additions & 0 deletions src/stores/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const useSettingsStore = defineStore('settings', {
flatmapAPI: undefined,
nlLinkPrefix: undefined,
flatmapAPI2: "https://mapcore-demo.org/curation/flatmap/",
mapManager: undefined,
rootUrl: undefined,
facets: { species: [], gender: [], organ: [] },
numberOfDatasetsForFacets: [],
Expand Down Expand Up @@ -67,6 +68,9 @@ export const useSettingsStore = defineStore('settings', {
updateFlatmapAPI2(flatmapAPI2) {
this.flatmapAPI2 = flatmapAPI2;
},
updateMapManager(mapManager) {
this.mapManager = mapManager;
},
updateNLLinkPrefix(nlLinkPrefix) {
this.nlLinkPrefix = nlLinkPrefix;
},
Expand Down

0 comments on commit d38f1ca

Please sign in to comment.