Webgl icon example / render map when texture ready

This commit is contained in:
Olivier Guyot
2019-08-31 08:59:34 +02:00
parent 732b383b53
commit 05a0600fe5

View File

@@ -17,7 +17,7 @@ const vectorSource = new Vector({
attributions: 'National UFO Reporting Center'
});
const texture = document.createElement('img');
const texture = new Image();
texture.src = 'data/ufo_shapes.png';
// This describes the content of the associated sprite sheet
@@ -136,3 +136,7 @@ map.on('pointermove', function(evt) {
info.innerText = 'On ' + datetime + ', lasted ' + duration + ' seconds and had a "' + shape + '" shape.';
});
});
texture.addEventListener('load', function() {
map.render();
});