Skip to content

Commit

Permalink
Hide marker once done
Browse files Browse the repository at this point in the history
  • Loading branch information
frodrigo committed May 5, 2024
1 parent ce419a5 commit 608036b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/issues_tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def _errors_mvt(
for res in sorted(results, key=lambda res: -res["lat"]):
issues_features.append(
{
"id": res["id"],
"geometry": Point(res["lon"], res["lat"]),
"properties": {
"uuid": str(res["uuid"]),
Expand Down
6 changes: 6 additions & 0 deletions web/static/map/Osmose.Marker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default class OsmoseMarker {
this._closePopup()
} else {
this.highlight = e.features[0].properties.uuid
this.feature_id = e.features[0].id
this._openPopup(
e.features[0].properties.uuid,
e.features[0].geometry.coordinates.slice(),
Expand Down Expand Up @@ -143,6 +144,11 @@ export default class OsmoseMarker {
}

corrected(): void {
this._map.setFeatureState(
{source: 'markers', sourceLayer: 'issues', id: this.feature_id},

Check failure on line 148 in web/static/map/Osmose.Marker.ts

View workflow job for this annotation

GitHub Actions / lint-web

Replace `source:·'markers',·sourceLayer:·'issues',·id:·this.feature_id` with `·source:·'markers',·sourceLayer:·'issues',·id:·this.feature_id·`
{hidden: true}

Check failure on line 149 in web/static/map/Osmose.Marker.ts

View workflow job for this annotation

GitHub Actions / lint-web

Replace `hidden:·true` with `·hidden:·true·`
)

this._closePopup()
}

Expand Down
3 changes: 3 additions & 0 deletions web/static/map/layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@ export const glStyle = {
'icon-allow-overlap': true,
visibility: 'none',
},
paint: {
'icon-opacity': ['case', ['feature-state', 'hidden'], 0, 1],
},
},
{
id: 'markers-limit',
Expand Down

0 comments on commit 608036b

Please sign in to comment.