Webgl icon example / render map when texture ready
This commit is contained in:
@@ -17,7 +17,7 @@ const vectorSource = new Vector({
|
|||||||
attributions: 'National UFO Reporting Center'
|
attributions: 'National UFO Reporting Center'
|
||||||
});
|
});
|
||||||
|
|
||||||
const texture = document.createElement('img');
|
const texture = new Image();
|
||||||
texture.src = 'data/ufo_shapes.png';
|
texture.src = 'data/ufo_shapes.png';
|
||||||
|
|
||||||
// This describes the content of the associated sprite sheet
|
// 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.';
|
info.innerText = 'On ' + datetime + ', lasted ' + duration + ' seconds and had a "' + shape + '" shape.';
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
texture.addEventListener('load', function() {
|
||||||
|
map.render();
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user