Diego
April 11, 2018, 5:55pm
1
Hello. I’m try to adapt openlayers to download TiledMaps via IPFS.
I’m using js-ipfs, and my code is there https://github.com/RDiegoSuarez/GeoSwarm-client
This is a very early stage,
But i have a problem. My app doesn’t see tiles until i have downloaded them from another tab in https://ipfs.io/ipfs/HASH/file_path .
Any suggestion ?
May be there is others similar projects that i can contribute instead of developping a solution from scratch.
3 Likes
Diego
April 12, 2018, 5:33am
2
Hello, again. Does anybody have an an idea about my problem ?
This is a kind of google maps using IPFS to store and get the tiles.
But js-ipfs in the browser isn’t really working…
hello i run your project
in log i have that :
/ipfs/QmWPvCEnSkGR8iTs6uiZSNkbupbv7sz3MV5mKW3erHYVZa/world/z0/0_0.png
ipfs.js:80 GOT => 0_0.png
correct log or not ?
Regards
vmx
April 12, 2018, 10:49am
4
I tried it locally with Firefox and I got an OpenLayers instance showing a world map the first time i opened it.
hi in my side i use google chrome
Diego
April 12, 2018, 6:07pm
6
Hi.
Thank you both for your test.
Yes a map is on screen. But if you “zoom” and “move” you will see pixelization.
That’s because openlayers is doing a “soft zoom” with previous zoom image as a basis
But the true tile is not coming until i access it directly from ipfs.io
You can debug this via the console.
After some zoom and move, you see the request message, but no “GOT” msg.
I don’t understand why.
vmx
April 12, 2018, 7:28pm
7
I’d take OpenLayers out of the equation for finding the issue. I did the following from the web console:
node.files.get('/ipfs/QmWPvCEnSkGR8iTs6uiZSNkbupbv7sz3MV5mKW3erHYVZa/world/z0').then((data) => { console.log('data:', data) }).catch((err) => { console.log('error:', err)})
> Promise { <state>: "pending" }
> data: Array [ {…}, {…} ]
node.files.get('/ipfs/QmWPvCEnSkGR8iTs6uiZSNkbupbv7sz3MV5mKW3erHYVZa/world/z1').then((data) => { console.log('data:', data) }).catch((err) => { console.log('error:', err)})
> Promise { <state>: "pending" }
So on z1
the Promise was always “pending”, it never resolved or errored.
Diego
April 13, 2018, 4:55am
8
Then you open a tab, or a new browser, and go to
https://ipfs.io/ipfs/QmWPvCEnSkGR8iTs6uiZSNkbupbv7sz3MV5mKW3erHYVZa/world/z1
And … magic ! The answer is coming back in your console …
A ressource is “downloadedable” by js-ipfs only if a “true” node have already seen it.
vmx
April 16, 2018, 8:52am
9
I’ve tried it again, now zooming in and out works correctly for me. I don’t know if it’s due to visiting the link above or something got fixed. Can you try it again?
Diego
April 16, 2018, 6:49pm
10
Hi.
I’ve developed a little script that do a wget for each tiles on ipfs.io .
That the only solution i’ve found for now.
May be it is because js-ipfs is not finished yet.
For example, the DHT is not implemented.
I will release a new data soon.
I will see if there is another way
But, thank you vmx …
2 Likes
hud
March 16, 2021, 3:03am
11
@vmx @Diego was wondering if you guys are still working on this? If not, what was the obstacle?