Sync form state with map on load

This commit is contained in:
Maximilian Krög
2022-08-20 11:21:44 +02:00
parent a10c93d331
commit defb6875d7

View File

@@ -139,12 +139,19 @@ searchButton.onclick = function (event) {
/** /**
* Handle checkbox change events. * Handle checkbox change events.
*/ */
renderEdgesCheckbox.onchange = function () { function onReprojectionChange() {
osmSource.setRenderReprojectionEdges(renderEdgesCheckbox.checked); osmSource.setRenderReprojectionEdges(renderEdgesCheckbox.checked);
}; }
showTilesCheckbox.onchange = function () { function onGraticuleChange() {
debugLayer.setVisible(showTilesCheckbox.checked);
};
showGraticuleCheckbox.onchange = function () {
graticule.setVisible(showGraticuleCheckbox.checked); graticule.setVisible(showGraticuleCheckbox.checked);
}; }
function onTilesChange() {
debugLayer.setVisible(showTilesCheckbox.checked);
}
showGraticuleCheckbox.addEventListener('change', onGraticuleChange);
renderEdgesCheckbox.addEventListener('change', onReprojectionChange);
showTilesCheckbox.addEventListener('change', onTilesChange);
onReprojectionChange();
onGraticuleChange();
onTilesChange();