Fix error in view-padding example
An error occured when the buttons are clicked before the source is loaded.
This commit is contained in:
@@ -50,6 +50,7 @@ const map = new Map({
|
||||
view: view,
|
||||
});
|
||||
|
||||
vectorLayer.getSource().on('featuresloadend', function () {
|
||||
const zoomtoswitzerland = document.getElementById('zoomtoswitzerland');
|
||||
zoomtoswitzerland.addEventListener(
|
||||
'click',
|
||||
@@ -71,3 +72,4 @@ centerlausanne.addEventListener(
|
||||
},
|
||||
false
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user