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:
parent
33347f7fc2
commit
118ad4e8cc
1 changed files with 1 additions and 1 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue