Skip to content

Commit

Permalink
fix(ios): fullscreen API not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
azarz committed Oct 21, 2024
1 parent 0e85227 commit b0f50a9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/js/event-listeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,18 +301,6 @@ function addListeners() {
}
});
});

DOM.$map.addEventListener("fullscreenchange", () => {
if (document.fullscreenElement) {
DOM.$map.appendChild(DOM.$interactivityBtn);
DOM.$map.appendChild(DOM.$mapScale);
Globals.interactivityIndicator.hardDisable();
} else {
DOM.$map.parentNode.parentNode.appendChild(DOM.$interactivityBtn);
DOM.$bottomButtons.appendChild(DOM.$mapScale);
Globals.interactivityIndicator.enable();
}
});
}

export default {
Expand Down
12 changes: 12 additions & 0 deletions src/js/map-buttons-listeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ const addListeners = () => {
Globals.menu.close("selectOnMapLandmark");
}
});

DOM.$fullScreenBtn.addEventListener("click", () => {
if (DOM.$fullScreenBtn.querySelector("button").classList.contains("maplibregl-ctrl-shrink")) {
DOM.$map.appendChild(DOM.$interactivityBtn);
DOM.$map.appendChild(DOM.$mapScale);
Globals.interactivityIndicator.hardDisable();
} else {
DOM.$map.parentNode.parentNode.appendChild(DOM.$interactivityBtn);
DOM.$bottomButtons.appendChild(DOM.$mapScale);
Globals.interactivityIndicator.enable();
}
});
};

export default {
Expand Down

0 comments on commit b0f50a9

Please sign in to comment.