I wrote the following code:
var icon = new ol.style.Icon({
src: '33496-1.png', // THIS IMAGE DOES NOT EXIST
scale: 0.7
});
icon.load();
if (icon.getImageState() === ol.style.ImageState.ERROR) {
vector.setStyle(new ol.style.Style({
image: new ol.style.Icon({
src: 'no-icon.png',
scale: 0.7
})
}));
} else if (icon.getImageState() === ol.style.ImageState.LOADING ||
icon.getImageState() === ol.style.ImageState.LOADED) {
vector.setStyle(new ol.style.Style({
image: icon
}));
}
it works with firebug because of breakpoints. In fact the load function is
still running. How can i catch the event load or error or onchange on this
icon
Thanks in advance
--
You received this message because you are subscribed to the Google Groups "OL3
Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/ol3-dev.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ol3-dev/ad02c20e-9d8d-4415-b661-fbbd6814690f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.