From ca1fb42120f4088aa3ea3c96ea844ad071c69744 Mon Sep 17 00:00:00 2001 From: Cyrus Hiatt Date: Tue, 26 Nov 2024 11:52:18 -0800 Subject: [PATCH] Appease typescript linter --- .../InteractiveMap/components/MapComponent.vue | 8 +++++--- .../Search/components/SearchResultItem.vue | 18 ++++++++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) 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 @@