My PWA (using Leaflet 1.5.1) is currently running (since 2 years) on Android and iOS without problems, until iOS 12 was released. From that point on I have very weird issues on iPhone and iPad.
Main problem is that image overlays are not fully rendering on iOS devices.
I am setting up an array of overlays:
ovl = loadOverlay(url);
overlay.push(ovl);
where loadOverlay() is:
function loadOverlay(imgurl) {
bounds = new L.LatLngBounds(
new L.LatLng(30, -10),
new L.LatLng(50, 36)
);
var ovl = new L.ImageOverlay(imgurl,
bounds, {
pane: 'imagebg',
attribution: "my attribution"
});
return ovl;
}
Then, each overlay is displayed this way:
startMap() {
mymap = new L.Map('CopMap', {
maxZoom: 6.50,
minZoom: 4.75,
zoomSnap: 0.25,
zoomDelta: 0.25,
zoomControl: false,
maxBounds: [
//south west
[32.5, -4.],
//north east
[46.8, 31]
],
crs: L.CRS.Simple
});
mymap.setView([41.5, 13], 5.25);
mymap.attributionControl.setPrefix('');
mymap.createPane('imagebg');
mymap.getPane('imagebg').style.zIndex = 1;
mymap.addLayer(overlay[iDX]);
}
This is working fine on Android, while in iOS the image is not fully rendered (not always, but very often). I have checked that the image file is correctly downloaded in the cache, but not fully displayed
leaflet-src.js
and a lot of debugging with use ofconsole.log
. And maybe reporting irregular behaviour at github.com/Leaflet/Leaflet/issues