Skip to content

Commit

Permalink
Fix a bug causing marker to not set the facet on sidebar properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-wu committed Feb 28, 2023
1 parent f50f6e5 commit 9aa8bfa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@abi-software/mapintegratedvuer",
"version": "0.3.13",
"version": "0.3.13-fixes-1",
"scripts": {
"serve": "vue-cli-service serve --port 8081",
"build": "vue-cli-service build --mode prod",
Expand Down
8 changes: 3 additions & 5 deletions src/components/viewers/Flatmap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
:helpMode="helpMode"
:pathControls="entry.pathControls"
ref="flatmap"
@ready="updateMarkers"
@ready="getAvailableTerms"
:displayMinimap="true"
:flatmapAPI="flatmapAPI"
/>
Expand Down Expand Up @@ -85,10 +85,8 @@ export default {
return store.state.settings.facets.species;
},
},
watch: {
facetSpecies: function () {
this.updateMarkers(this.$refs.flatmap);
}
mounted: function() {
this.getAvailableTerms();
},
};
</script>
Expand Down
4 changes: 2 additions & 2 deletions src/components/viewers/MultiFlatmap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import markerZoomLevels from '../markerZoomLevels';
* I have modified it to make sure the marker is displayed
* if the uberon is not present in the hardcoded zoom-level list.
*/
const checkMarkersAtZoomLevel = (flatmapImp, markers, zoomLevel) => {
if (markers) {
markers.forEach(id => {
Expand Down Expand Up @@ -266,14 +265,15 @@ export default {
watch: {
// disable this now that we pull directly from the sidebar
// facetSpecies: function () {
// this.updateMarkers(this.$refs.multiflatmap.getCurrentFlatmap());
// this.getAvailableTerms();
// },
syncMode: function (val) {
if (this.$refs.multiflatmap.getCurrentFlatmap())
this.$refs.multiflatmap.getCurrentFlatmap().enablePanZoomEvents(val);
},
},
mounted: function() {
this.getAvailableTerms();
EventBus.$on('markerUpdate', ()=>{
this.flatmapMarkerZoomUpdate(true);
})
Expand Down
15 changes: 2 additions & 13 deletions src/mixins/ContentMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,27 +233,18 @@ export default {
requestSynchronisedEvent: function () {
return;
},
updateMarkers: function (component) {
let map = component.mapImp;
map.clearMarkers();
let params = [];
getAvailableTerms: function () {
//Use the default list of uberons before we get the list from
//the api
let terms = getAvailableTermsForSpecies();
for (let i = 0; i < terms.length; i++) {
map.addMarker(terms[i].id, terms[i].type);
this.idNamePair[terms[i].id] = terms[i].name;
}
if (this.apiLocation) {
store.state.settings.facets.species.forEach((e) => {
params.push(
encodeURIComponent("species") + "=" + encodeURIComponent(e)
);
});
if (this._controller) this._controller.abort();
this._controller = new AbortController();
let signal = this._controller.signal;
fetch(`${this.apiLocation}get-organ-curies?${params.join("&")}`, {
fetch(`${this.apiLocation}get-organ-curies`, {
signal,
})
.then((response) => response.json())
Expand All @@ -262,9 +253,7 @@ export default {
data.uberon.array.forEach((pair) => {
this.idNamePair[pair.id.toUpperCase()] =
pair.name.charAt(0).toUpperCase() + pair.name.slice(1);
map.addMarker(pair.id.toUpperCase(), "simulation");
});
this.flatmapMarkerZoomUpdate();
return;
}
);
Expand Down

0 comments on commit 9aa8bfa

Please sign in to comment.