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,
|
view: view,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
vectorLayer.getSource().on('featuresloadend', function () {
|
||||||
const zoomtoswitzerland = document.getElementById('zoomtoswitzerland');
|
const zoomtoswitzerland = document.getElementById('zoomtoswitzerland');
|
||||||
zoomtoswitzerland.addEventListener(
|
zoomtoswitzerland.addEventListener(
|
||||||
'click',
|
'click',
|
||||||
@@ -71,3 +72,4 @@ centerlausanne.addEventListener(
|
|||||||
},
|
},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user