diff --git a/.changeset/serious-jokes-flash.md b/.changeset/serious-jokes-flash.md
new file mode 100644
index 0000000000..e3642c6516
--- /dev/null
+++ b/.changeset/serious-jokes-flash.md
@@ -0,0 +1,5 @@
+---
+"geohub": patch
+---
+
+fix: add buttons in selected feature table in STAC API Explorer to deselect a feature or all features.
diff --git a/sites/geohub/src/components/util/stac/StacApiExplorer.svelte b/sites/geohub/src/components/util/stac/StacApiExplorer.svelte
index b69015ba55..a7d1fcdd31 100644
--- a/sites/geohub/src/components/util/stac/StacApiExplorer.svelte
+++ b/sites/geohub/src/components/util/stac/StacApiExplorer.svelte
@@ -25,6 +25,7 @@
clean,
DatePicker,
FieldControl,
+ initTooltipTippy,
Notification,
type RasterAlgorithm,
type RasterTileMetadata,
@@ -52,6 +53,8 @@
const NOTIFICATION_MESSAGE_TIME = 5000;
const MAX_ZOOM = 8;
+ const tooltipTippy = initTooltipTippy();
+
let config: UserConfig = $page.data.config;
export let stacId: string;
@@ -466,6 +469,18 @@
}
};
+ const removeClickedFeature = (feature?: MapGeoJSONFeature) => {
+ if (feature) {
+ map.setFeatureState(feature, { click: false });
+ clickedFeatures = [...clickedFeatures.filter((f) => f !== feature)];
+ } else {
+ for (const feature of clickedFeatures) {
+ map.setFeatureState(feature, { click: false });
+ }
+ clickedFeatures = [];
+ }
+ };
+
const handleSelectedAssets = async () => {
selectedProduct = '';
assetSelectionDone = !assetSelectionDone;
@@ -939,7 +954,7 @@
No. | @@ -947,21 +962,43 @@ {#if stacInstance.hasCloudCoverProp}Cloud cover (%) | {/if} ++ + | |||
---|---|---|---|---|---|
{index + 1} | -{index + 1} + | {#if stacInstance.hasCloudCoverProp} - | {feature.properties[stacInstance.cloudCoverPropName].toFixed(2)}% | +{feature.properties[stacInstance.cloudCoverPropName].toFixed(2)}% | {/if} ++ + |