resize box on window resize
This commit is contained in:
parent
2f5dddde8b
commit
296ed8da8a
1 changed files with 7 additions and 2 deletions
|
@ -140,14 +140,19 @@ async function initLimitsBox(map, btn) {
|
||||||
await getServerBoxBounds(map, box);
|
await getServerBoxBounds(map, box);
|
||||||
box.addTo(map);
|
box.addTo(map);
|
||||||
|
|
||||||
map.on("zoom move", () => {
|
map.on("zoom move zoomend moveend", () => {
|
||||||
box.setBounds(getRectangleCoord(map))
|
box.setBounds(getRectangleCoord(map))
|
||||||
})
|
})
|
||||||
|
|
||||||
btn.addEventListener("click", () => {
|
btn.addEventListener("click", () => {
|
||||||
getServerBoxBounds(map, box)
|
getServerBoxBounds(map, box);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
addEventListener("resize", () => {
|
||||||
|
getServerBoxBounds(map, box);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createRectangleBox(map) {
|
function createRectangleBox(map) {
|
||||||
|
|
Loading…
Reference in a new issue