Another problem I have........I know how to preload images using jquery, but how can preloading be done with static images?
IMG_LYRbounds = [45.3, 30.9, -14.6, 72.6]; // LON/LAT
url = "http://localhost/img/myupdatedimgXX.png";
IMG_LYR = new ol.layer.Image({
source: IMG_LYRStaticSource
});
IMG_LYRStaticSource = new ol.source.ImageStatic({
url: url,
projection: "EPSG:3857",
imageExtent: ol.extent.applyTransform(IMG_LYRbounds, ol.proj.getTransform("EPSG:4326","EPSG:3857)
});
The static image layer stays the same and the source (url) is changing on mouseover.
The preloading part is especially needed when I have 2 or more image layers and I need to show the image layers in one go (and prevent img-layer1 showing where img-layer2 is still loading and comes up a few seconds later).