diff --git a/afrc/src/afrc/Search/components/InteractiveMap/components/MapComponent.vue b/afrc/src/afrc/Search/components/InteractiveMap/components/MapComponent.vue index a2a9d80..1a0facf 100644 --- a/afrc/src/afrc/Search/components/InteractiveMap/components/MapComponent.vue +++ b/afrc/src/afrc/Search/components/InteractiveMap/components/MapComponent.vue @@ -88,7 +88,7 @@ const { drawnFeaturesBuffer, } = props; -let resultsSelected = inject("resultsSelected"); +let resultsSelected = inject("resultsSelected") as Ref; const emits = defineEmits([ "mapInitialized", @@ -129,7 +129,9 @@ watch( watch( () => resultsSelected, (selected) => { - updateFeatureSelection(selected); + if (selected) { + updateFeatureSelection(selected as Ref); + } }, {deep: true} ); @@ -204,7 +206,7 @@ function updateFeatureSelection(selected: Ref) { const features = map.value!.queryRenderedFeatures({layers:layers}); features.forEach(feature => { const featureSelected = selected.value.includes(feature.properties?.resourceinstanceid); - map.value.setFeatureState( + map.value!.setFeatureState( { source: "referencecollections", sourceLayer: "referencecollections", diff --git a/afrc/src/afrc/Search/components/SearchResultItem.vue b/afrc/src/afrc/Search/components/SearchResultItem.vue index df80f59..c7ec503 100644 --- a/afrc/src/afrc/Search/components/SearchResultItem.vue +++ b/afrc/src/afrc/Search/components/SearchResultItem.vue @@ -1,8 +1,9 @@