Leaflet / Leaflet

🍃 JavaScript library for mobile-friendly interactive maps 🇺🇦
https://leafletjs.com
BSD 2-Clause "Simplified" License
40.17k stars 5.75k forks source link

"An error occurred trying to load the resource" - error in network tab when no visible missing tile #9311

Open Vasilia-Themis opened 1 month ago

Vasilia-Themis commented 1 month ago

Checklist

Steps to reproduce

Bug reproduced on a number of different iOS devices Unable to reproduce on Android or desktop

Expected behavior

Current behavior

image

image

Minimal example reproducing the issue

https://plnkr.co/edit/YiUS1lMzYAIZwLUs?preview

Environment

IvanSanchez commented 1 month ago

That URL is the one for a 1x1 transparent gif image (gosh, knowing that fact makes me a nerd). In the leaflet codebase it lives at L.Util.emptyImageURL, and is set into tiles at:

https://github.com/Leaflet/Leaflet/blob/39ce11753b6bc193d9fc91c676d3f2acc1dbec90/src/layer/tile/TileLayer.js#L242

It has no ill effect besides that warning. It's done for historical reasons: destroying a non-completely-loaded HTMLImageElement used to crash the Android stock browser. See https://github.com/Leaflet/Leaflet/issues/137 and https://github.com/Leaflet/Leaflet/pull/5615 .

Not sure if we want to revisit this?

Vasilia-Themis commented 1 month ago

Thank you for the quick reply @IvanSanchez. It seems to be linked with the publishing of a tileerror event on the TileLayer, which is causing us problems. This only happens intermittently so I'm not confident of the link. Does that sound plausible?

IvanSanchez commented 1 month ago

But this is a non-issue anyway. The Safari dev tools are failing to display an image coming from a data: URL, which is different than "an image is causing an error" (since there are no errors/warnings in your console anyway).

If you have something about tileerror, then that's a different issue. Let's stick to this one.