Skip to content

Commit

Permalink
Fix hover state for features with ID 0 (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster authored Jul 3, 2023
1 parent ad6bb3e commit 07a89f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/Layer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
let featureId = features[0]?.id;
if (featureId !== hoverFeatureId) {
if (manageHoverState) {
if (hoverFeatureId) {
if (hoverFeatureId !== undefined) {
$map?.setFeatureState({ source: actualSource!, id: hoverFeatureId }, { hover: false });
}
Expand Down Expand Up @@ -178,7 +178,7 @@
}
hovered = null;
if (manageHoverState && hoverFeatureId) {
if (manageHoverState && hoverFeatureId !== undefined) {
$map?.setFeatureState({ source: actualSource!, id: hoverFeatureId }, { hover: false });
hoverFeatureId = undefined;
}
Expand Down

1 comment on commit 07a89f1

@vercel
Copy link

@vercel vercel bot commented on 07a89f1 Jul 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.