Dear all,
Does any of you knows a simple and CORS unaffected way of changing an L.imageOverlay image of the specified one does not exist?
I mean, i have, as a minimal working example
var startDate = new Date();
var today=(startDate.toISOString().slice(0,10).replace(/-/g,""));
var imageUrltoday='
http://somesite.somedomain/'+today+'/day_0.png';
var imageBounds= [[36.25710105895996,-10.347503662109375],[42.64484977722168,-5.233795166015625]];
var map = L.map('map', {
zoom: 5,
fullscreenControl: true,
timeDimension: false,
center: [40.0, -4.50],
});
var image_today=L.imageOverlay(imageUrltoday, imageBounds, {opacity: 0.7, attribution: 'blablabla'});
image_today.addTo(map);
so, the day_0.png might not always exist, and i'd like to replace it when it doesn't, by another image.
Can Anyone give me a hand on this?
Thanks in advance!
regards