Skip to content

Commit

Permalink
feat(main):: layer add to display bad geometries
Browse files Browse the repository at this point in the history
  • Loading branch information
NSUWAL123 committed Jan 13, 2025
1 parent fc36812 commit 276c70e
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions src/mapper/src/lib/components/map/main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,19 @@
selectedBaselayer = 'PMTiles';
}
setInterval(() => {
const interval = setInterval(() => {
if (expanding) {
lineWidth += 0.3;
if (lineWidth >= 6) expanding = false; // Maximum width
if (lineWidth >= 4) expanding = false; // Maximum width
} else {
lineWidth -= 0.3;
if (lineWidth <= 1) expanding = true; // Minimum width
}
}, 50); // Update every 50ms for smooth animation
return () => {
clearInterval(interval);
};
});
</script>

Expand Down Expand Up @@ -424,7 +428,7 @@
<FillLayer
id="entity-fill-layer"
paint={{
'fill-opacity': 0.6,
'fill-opacity': ['match', ['get', 'status'], 'MARKED_BAD', 0, 0.6],
'fill-color': [
'match',
['get', 'status'],
Expand Down Expand Up @@ -466,6 +470,27 @@
manageHoverState
/>
</FlatGeobuf>
<GeoJSON id="bad-geoms" data={entitiesStore.badGeomList}>
<FillLayer
id="bad-geom-fill-layer"
hoverCursor="pointer"
paint={{
'fill-color': '#fa1100',
'fill-opacity': 0.3,
}}
beforeLayerType="symbol"
manageHoverState
/>
<LineLayer
layout={{ 'line-cap': 'round', 'line-join': 'round' }}
paint={{
'line-color': '#fa1100',
'line-width': lineWidth,
}}
beforeLayerType="symbol"
manageHoverState
/>
</GeoJSON>

<!-- pulse effect layer representing rejected entities -->

Expand Down

0 comments on commit 276c70e

Please sign in to comment.