[openstreetmap/openstreetmap-website] Split interactive history layer into areas and borders above areas (PR #5963)
Marwin Hochfelsner
notifications at github.com
Tue Apr 29 23:04:08 UTC 2025
@hlfan requested changes on this pull request.
> this._highlightLayer.clearLayers();
for (const changeset of this._changesets.values()) {
- const rect = L.rectangle(changeset.bounds, this._getInteractiveStyle(changeset));
+ const rect = L.rectangle(changeset.bounds, this._getAreaStyle(changeset));
+ rect.id = changeset.id;
+ rect.addTo(this._areaLayer);
+ }
+
+ for (const changeset of this._changesets.values()) {
+ const rect = L.rectangle(changeset.bounds, this._getBorderStyle(changeset));
But at that stage you don't need the changeset reference anymore.
```javascript
const changesetAreas = [];
const changesetBorders = [];
for (const changeset of this._changesets.values()) {
const arect = L.rectangle(changeset.bounds, { className: this._getSidebarRelativeClassName(changeset)) });
const brect = L.rectangle(changeset.bounds, { className: this._getSidebarRelativeClassName(changeset)) });
arect.id = brect.id = changeset.id;
changesetAreas.push(arect);
changesetBorders.push(arect);
}
changesetAreas.forEach(a => this._areaLayer.addLayer(a));
changesetBorders.forEach(b => this._borderLayer.addLayer(b));
this._areaLayer.setStyle({
weight: 0,
fillOpacity: 0
});
this._borderLayer.setStyle({
weight: 2,
color: "var(--changeset-border-color)",
fill: false
});
```
No get...Style wrappers around _getSidebarRelativeClassName needed.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5963#pullrequestreview-2805284149
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5963/review/2805284149 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250429/62365b7d/attachment.htm>
More information about the rails-dev
mailing list