Currently I am using leafletjs for showing maps. Is there a way I can detect browser offline or online status.
-
html5rocks.com/en/mobile/workingoffthegrid– Anatolii SuhanovCommented May 1, 2018 at 4:13
-
Thanks for the suggestion. But actually the leafletjs library internally calls osm.org in order to get the '.png' files. I see it call multiple urls with different sub domaine based based on the zoom level. for example a.osm.org/1/2/3 b.osm.org/2/4/5 and so on. Not sure if I can check the connectivity with a specific url ? As the url are continuously changing.– Pradyumna RavuriCommented May 3, 2018 at 0:03
-
1You can omit the subdomain, e.g. by using tile.openstreetmap.org/0/0/0.png instead of c.tile.openstreetmap.org/0/0/0.png. The subdomains are just used to trick the browser into creating more simultaneous connections than with a single domain, as far as I know.– scaiCommented May 3, 2018 at 10:33
-
1Re " leafletjs library internally calls osm.org in order to get the '.png' files" - not really; it fetches .png tiles from wherever you say they should come from. That might be OSM's own tiles (subject to the usage limits!) or can be anywhere you specify, such as local storage.– SomeoneElseCommented May 8, 2018 at 10:56
-
@scai Yep, I see I can simply call tile.openstreetmap instead of calling with subdomine.– Pradyumna RavuriCommented May 8, 2018 at 23:22
|
Show 1 more comment