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);
|
||||
box.addTo(map);
|
||||
|
||||
map.on("zoom move", () => {
|
||||
map.on("zoom move zoomend moveend", () => {
|
||||
box.setBounds(getRectangleCoord(map))
|
||||
})
|
||||
|
||||
btn.addEventListener("click", () => {
|
||||
getServerBoxBounds(map, box)
|
||||
getServerBoxBounds(map, box);
|
||||
});
|
||||
|
||||
addEventListener("resize", () => {
|
||||
getServerBoxBounds(map, box);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
function createRectangleBox(map) {
|
||||
|
|
Loading…
Reference in a new issue