Hello everyone, it is the first time i write here, kind of newbie to ipfs.
I am developing an application that needs to show locations on a map, i have it already working, but i am hosting the .png tiles which i get from openstreetmap through a local proxy.
Ok, some context:
If you want to show a map on your application, for instance, like this OpenStreetMap you have the option to use .png files organized by zoom levels and tiles.
The tiles for the entire world are many, which means that storage and network transmission are two things you have to think about when you are developing such an application.
Now, openstreetmap .org has all the tiles in their own servers, they are altruist people and they give them to you for free, yet they advice you to not to use their servers as your application tile server, you know, they pay for it …
A simple solution is to proxy and cache requested tiles.
When your server receives a tile request from your client application, it checks if it already has it cached, if so, it checks for an expiration date (we configure somewhere), if both checks are true, we serve the cached tile, else, we request it from openstreetmap, cache it, set an expiration date, and serve it to our application client.
An expiration date is needed because the tiles are not static, they change, slowly over time as the real streets change and people update the corresponding tiles in openstreetmap.
There are several http tile server services, some paid, some for free (as osm)
You can configure your application’s map handler to use those servers, for instance, you can use [https]://openlayers.org/ as your map handler and configure a tile source server let’s say [https]://exmple.io?x={x}&y={y},
or [https]://a.tile.openstreetmap.org/{x}/{y}/{z}.png
where ‘x’ and ‘y’ are variables.
Example time: https://a.tile.openstreetmap.org/6/32/22.png
I wonder if a similar application already exists on the ipfs ecosystem, but i wasn’t able to find anything working.
I know, it would be possible to take a snapshot of the entire world, add it to ipfs and weekly publish it to a ipns name, let’s say Qmfdjskjdhf, so we could be able to change
from [https]://exmple.com?x={x}&y={y}
to [https]://some-randomly-choosen-ipfs-gateway.io/ipns/Qmfdjskjdhf/{x}/{y}
or simply /ipns/Qmfdjskjdhf/{x}/{y}
I thought, maybe i can run a ipfs node, use my peerid to publish a directory, and at some point (maybe when other nodes are searching for my peerid), i think my node will receive some kind of request asking for Qmfdjskjdhf/{x}/{y}, then execute the proxy system to add new tiles to ipfs, if needed.
Sounds like it is not possible, i bet you have to have the content before publishing something to ipns
Is there something similar already done
is it even possible ?
Do i have to try the “weekly updated entire world” way ?
Thank you very much