WeatherMap: actually move the legend to top-right

The previous fix only updated the initial mount path. buildLegend gets
re-created on every layer switch via the swap at renderLayer, and that
code path still used the old isMobile-dependent bottomright position,
which clobbered the top-right placement as soon as the user clicked a
different layer.
This commit is contained in:
Graham McIntire 2026-04-15 14:12:29 -05:00
parent 33347f7fc2
commit 118ad4e8cc
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

@ -646,7 +646,7 @@ export const WeatherMap: WeatherMapHook = {
if (this.legend) {
this.map.removeControl(this.legend)
this.legend = L.control({ position: isMobile() ? "topright" : "bottomright" })
this.legend = L.control({ position: "topright" })
this.legend.onAdd = () => this.buildLegend()
this.legend.addTo(this.map)
}