datopian / data-explorer

Data Explorer app and components built in React oriented to use with CKAN
https://tech.datopian.com/data-explorer/
14 stars 8 forks source link

Maps are not rendered: openstreetmap net::ERR_NAME_NOT_RESOLVED #18

Open EvgeniiaVak opened 4 years ago

EvgeniiaVak commented 4 years ago

Steps to reproduce

  1. Using frontend-v2 latest version: https://github.com/datopian/frontend-v2/commit/e9df25e6c5cd2fa3eaeab072cdce10b569a02776
  2. Using Data Explorer latest version: https://github.com/datopian/data-explorer/commit/96dc7b3fde65b1022cdd6d9df00dbe3faf53cc37
  3. Using ODDK theme version from fix branch: https://github.com/datopian/frontend-oddk/commit/1a0913645ff8856d754e3d7c1c481f29db9c6dc1 (Just started to use data-explorer instead of datapackage-views-js, styles not configured yet)

The page loads the maps and the dots are there on the map, but the map itself is not there:

Screen Shot 2020-03-20 at 5 36 10 PM

And there is an exception in the browser logs:

b.tile.openstreetmap.org/11/1080/634.png:1 Failed to load resource: net::ERR_NAME_NOT_RESOLVED
EvgeniiaVak commented 4 years ago

Browsing through different openstreetmap resources I found that they work from TorBrowser but do not work in Google Chrome, e.g. for me https://b.tile.openstreetmap.org/11/1080/634.png works ok in Tor, but returns b.tile.openstreetmap.org’s server IP address could not be found. in other browsers. Might be an issue with local Russian opestreetmap servers (found this article: https://blog.openstreetmap.org/2012/10/24/new-tile-server-in-moscow/).

Another example the openstreetmap dns site (found in this repo - https://github.com/openstreetmap/dns): https://dns.openstreetmap.org/tile.openstreetmap.org.html

Here how it looks like in Chrome:

Screen Shot 2020-03-20 at 8 20 21 PM

and there is the same net::ERR_NAME_NOT_RESOLVED error in the browser console log - dns.openstreetmap.org-1584710572873.log

And here how it looks like in Tor:

Screen Shot 2020-03-20 at 8 21 34 PM

I have 3 hypotheses:

EvgeniiaVak commented 4 years ago

The resource is not officially blocked in Russia: https://eais.rkn.gov.ru/ did not find anything on tile.openstreetmap.org.

EvgeniiaVak commented 4 years ago

Tried to load the https://dns.openstreetmap.org/tile.openstreetmap.org.html from phone (not WIFI but cellular network - another Internet Provider) - same thing, not working: photo_2020-03-20 20 41 19

EvgeniiaVak commented 4 years ago

openstreetmap servers are not always up: https://uptime.openstreetmap.org/

Screen Shot 2020-03-20 at 9 19 19 PM
EvgeniiaVak commented 4 years ago

Interestingly if to use an iframe which uses ckan's view extention, the openstreetmap works:

<iframe width="700" height="400" src="https://admin.opendata.dk/dataset/bymiljo-aarhus-cityprobe/resource/2b503ea0-caec-4966-a293-7c2a56e6f5ce/view/42dec9c5-2b34-46ce-af1d-effd287cbc90" frameBorder="0"></iframe> 

iframe on top, data explorer below:

Screen Shot 2020-03-21 at 2 59 37 PM

The classic ckan approach also uses opensteetmaps.org with Leaflet but the difference is it's deployed in another country that has the access currently => If we are moving from the server (ckan classic approach) to the browser (which Data Explorer (or datapackage-views-js to be precise) does) some clients might not see the maps (currently it's happening in Russia and Georgia).

Although ckan uses a slightly different map tiles URL settings:

https://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png

which works for me too, e.g. this link https://stamen-tiles-b.a.ssl.fastly.net/terrain/11/1080/634.png shows the map:

Screen Shot 2020-03-21 at 4 46 03 PM

Although the openstreetmap.org also just started working, so maybe no difference here.

EvgeniiaVak commented 4 years ago

Possible solutions

  1. find ways to contribute to Open Street Maps project (make the GeoDNS route to a sertain server only when it's up) - a lot of unknowns here
  2. switch to a more stable service, e.g. google maps (it has freemium but is not of course as free as the Open Street Maps)
  3. host our own (Datopian) Open Street Maps server (I would vote for this one) - e.g. here is an example of how to do the set up with docker https://switch2osm.org/serving-tiles/using-a-docker-container/. Although it's a lot of data. From the wiki:

    Planet.osm is the OpenStreetMap data in one file: all the nodes, ways and relations that make up our map. A new version is released every week. It's a big file (on 2020-03-01, the plain OSM XML variant takes over 1192.4 GB when uncompressed from the 86.0 GB bzip2-compressed or 49.4 GB PBF-compressed downloaded data file).

  4. try to find a more stable free to use server

@zelima what do you think? do we have the capacity to serve our own Open Street Maps server?