We're having an issue regarding the loading of remote images with ImageResource. The documentation states that this should be possible, as the example in the documentation itself says
We use a similar code, but since we could not get it to work, we replaced it with dummy code to test for errors:
var posTypeImage = new AR.ImageResource("http://placehold.it/100x40", { onLoaded: function(width, height) { alert('Resource loaded!'); }, onError: function() { alert('An error occurred loading the resource!'); } });
However, this code never calls either onLoaded or onError. If I replace the URL with a URL to a local file in the bundle, it works flawlessly.
Do you have any insights why this might not work?
F
Florian Rath
said
about 10 years ago
To give a bit of background here:
We actually used HtmlDrawables for displaying some remote images on top of our marker. However the problem is that the HtmlDrawables hover on top of all other elements (including the Poi Radar), which makes it impossible to use for us.
Because of that we tried to switch to loading these images with ImageResources, which lead us to the error stated above.
W
Wolfgang Damm
said
about 10 years ago
Hi,
I checked your image and it is a .gif, which is currently not supported. We suggest using .png instead. However we will have a look at why the error trigger isn't called.
Let me know if you have any other problem after using a different image format (e.g. png).
F
Florian Rath
said
about 10 years ago
Thanks for clarification!
Maybe a hint in the docs would be nice that gifs are not supported.
Sadly switching to png is not an option for us, since the production code retrieves the images from a database with millions of gifs in it. But thanks anyways for your quick reply!
W
Wolfgang Damm
said
about 10 years ago
Good news: we have just added GIF support for our comming bugfix update, scheduled to be released in the next 2 weeks. Please stay tuned for it and test again once it is available.
Florian Rath