Skip to content

Commit 608036b

Browse files
committed
Hide marker once done
1 parent ce419a5 commit 608036b

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

api/issues_tiles.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def _errors_mvt(
6363
for res in sorted(results, key=lambda res: -res["lat"]):
6464
issues_features.append(
6565
{
66+
"id": res["id"],
6667
"geometry": Point(res["lon"], res["lat"]),
6768
"properties": {
6869
"uuid": str(res["uuid"]),

web/static/map/Osmose.Marker.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export default class OsmoseMarker {
4444
this._closePopup()
4545
} else {
4646
this.highlight = e.features[0].properties.uuid
47+
this.feature_id = e.features[0].id
4748
this._openPopup(
4849
e.features[0].properties.uuid,
4950
e.features[0].geometry.coordinates.slice(),
@@ -143,6 +144,11 @@ export default class OsmoseMarker {
143144
}
144145

145146
corrected(): void {
147+
this._map.setFeatureState(
148+
{source: 'markers', sourceLayer: 'issues', id: this.feature_id},
149+
{hidden: true}
150+
)
151+
146152
this._closePopup()
147153
}
148154

web/static/map/layers.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,9 @@ export const glStyle = {
386386
'icon-allow-overlap': true,
387387
visibility: 'none',
388388
},
389+
paint: {
390+
'icon-opacity': ['case', ['feature-state', 'hidden'], 0, 1],
391+
},
389392
},
390393
{
391394
id: 'markers-limit',

0 commit comments

Comments
 (0)