Thanks Tobias

Le samedi 25 juin 2016 13:49:00 UTC+2, Philippe prevautel a écrit :
>
> 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 ol3-dev+unsubscr...@googlegroups.com.
To post to this group, send email to ol3-dev@googlegroups.com.
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/db807243-1364-430a-ad45-aa16ed731a31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to