@AntonKhorev commented on this pull request.


> @@ -119,14 +119,12 @@ OSM.HistoryChangesetsLayer = L.FeatureGroup.extend({
     const changeset = this._changesets.get(id);
     if (!changeset) return;
 
-    let highlightRect = this._highlightLayer.getLayer(id);
-    if (!state && highlightRect) {
-      this._highlightLayer.removeLayer(highlightRect);
-    }
-    if (state && !highlightRect) {
-      highlightRect = L.rectangle(changeset.bounds, 
this._getHighlightStyle(changeset));
+    if (state) {
+      const highlightRect = L.rectangle(changeset.bounds, 
this._getHighlightStyle(changeset));

We are relying on:
- if the highlight layer is already added, it has correct geometry, style etc
- Leaflet [won't add a layer with the same id to the 
group](https://github.com/Leaflet/Leaflet/blob/c4a1e362bfd7f7709efdaff94f154e100a706129/src/layer/FeatureGroup.js#L29-L31),
 but looks like it's not documented unless [this counts as 
documented](https://github.com/Leaflet/Leaflet/pull/798)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5964#discussion_r2071742143
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/5964/review/2812235...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to