Skip to content

Commit

Permalink
Merge pull request #259 from alan-wu/fc-annotation
Browse files Browse the repository at this point in the history
Fix search and annotation on fc map.
  • Loading branch information
alan-wu authored Nov 20, 2024
2 parents 1a38403 + 515b2bc commit c71831b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/components/viewers/Flatmap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
@help-mode-last-item="onHelpModeLastItem"
@shown-tooltip="onTooltipShown"
@shown-map-tooltip="onMapTooltipShown"
@annotation-open="onAnnotationOpen"
@annotation-close="onAnnotationClose"
:annotationSidebar="annotationSidebar"
@connectivity-info-open="onConnectivityInfoOpen"
@connectivity-info-close="onConnectivityInfoClose"
:connectivityInfoSidebar="connectivityInfoSidebar"
Expand Down Expand Up @@ -131,7 +134,8 @@ export default {
searchSuggestions: function (term, suggestions) {
if (term && this.$refs.flatmap.mapImp) {
const results = this.$refs.flatmap.mapImp.search(term);
results.__featureIds.forEach(id => {
const featureIds = results.__featureIds || results.featureIds;
featureIds.forEach(id => {
const annotation = this.$refs.flatmap.mapImp.annotation(id);
if (annotation && annotation.label)
suggestions.push(annotation.label);
Expand Down Expand Up @@ -166,6 +170,12 @@ export default {
},
},
mounted: function() {
EventBus.on('annotation-close', (payload) => {
const currentFlatmap = this.$refs.flatmap;
if (payload?.tabClose && currentFlatmap) {
this.$refs.flatmap.annotationEventCallback({}, { type: 'aborted' })
}
});
EventBus.on("markerUpdate", () => {
this.flatmapMarkerUpdate(undefined);
});
Expand Down

0 comments on commit c71831b

Please sign in to comment.