We seem to be getting a few network errors where tile.openstreetmap.org (a,b,c, subdomains) are sometimes unavailable. What would be the best way to detect this and then display a message to the user that "Map is not Available"?
1 Answer, 1 is accepted
answered on 03 Jun 2019, 11:10 AM
Generally speaking, the map is a container full of img elements. each img element represents a tile. In other words, the images are requested by the browser - not by us and therefore we do not have access to that request and check whether it succeeded.
Nevertheless, you could add a service worker to your page and use it as a proxy to check whether there is a failing request.
Also, I can suggest you to take a look at the following thread where testing whether images are loaded correctly is discussed: