Full code cleanup

This commit is contained in:
Pieter Vander Vennet 2022-01-26 21:40:38 +01:00
parent 3a4a2a2016
commit fa971ffbbf
300 changed files with 16352 additions and 19284 deletions

View file

@ -84,7 +84,7 @@ class SingleLayerSelectionButton extends Toggle {
previousLayer.setData(previousLayer.data ?? available.data)
options.currentBackground.setData(previousLayer.data)
})
options.currentBackground.addCallbackAndRunD(background => {
if (background.category === options.preferredType) {
previousLayer.setData(background)
@ -103,9 +103,9 @@ class SingleLayerSelectionButton extends Toggle {
// The previously used layer doesn't match the current layer -> no need to switch
return;
}
// Is the previous layer still valid? If so, we don't bother to switch
if(previousLayer.data.feature === null || GeoOperations.inside(locationControl.data, previousLayer.data.feature)){
if (previousLayer.data.feature === null || GeoOperations.inside(locationControl.data, previousLayer.data.feature)) {
return
}