<p></p>
<blockquote>
<p dir="auto">But I found it too hacky to overwrite the class's properties from the instance each time, and I especially wanted to avoid using <code class="notranslate">__proto__</code>. Yet I couldn't find a way to do that.</p>
</blockquote>
<p dir="auto">I don't see any reason why what I was suggesting would need any of that but I've actually come up with a better solution now.</p>
<p dir="auto">What really bothered me was having the URL sometimes in leaflet-osm and sometimes here, so what I've done is to add a new <code class="notranslate">TransportDarkMap</code> layer to leaflet-osm in <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/openstreetmap/leaflet-osm/commit/ebfaf22426c265aaf3f401d70ffd02ca920623c9/hovercard" href="https://github.com/openstreetmap/leaflet-osm/commit/ebfaf22426c265aaf3f401d70ffd02ca920623c9">openstreetmap/leaflet-osm@<tt>ebfaf22</tt></a>.</p>
<p dir="auto">So now we can have a <code class="notranslate">leafletOsmDarkId: "TransportDarkMap"</code> key in <code class="notranslate">layers.yml</code> and if that key exists we construct that layer instead of the normal one and then don't do any filtering.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5397#issuecomment-2551365251">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLPTSDMOGJ4QAQ6QH5L2GF373AVCNFSM6AAAAABTRRNFV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNJRGM3DKMRVGE">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLPXH32YYSG622GZENL2GF373A5CNFSM6AAAAABTRRNFV6WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUYCK7IG.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5397/c2551365251</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5397#issuecomment-2551365251",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5397#issuecomment-2551365251",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>