-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow offline usage for POIs #1169
Comments
Reading more into the |
Also there's this library which can convert geojson to MVT (I hope): |
Problem:MVT does not support clustering right now see here (Only geojson source allows clustering): Soluton 1Following this guide to eliminate properties that are not needed for the clustering allows to lower the geojson size to be ~ 6 Mb (Which can be shipped with the app to allow initial usage without waiting). Solution 2Another option is to ditch the clustering and move to zoom based POI showing - much like how the map is currently working. Solution 3 - preferred:Another option which might combine both of the above is the following: |
OK, finally got the POC working. Clustering seems to be working, speed is a lot better.
There's a point to take into consideration here - when using features from a tiled source features can be duplicated, need to make sure they are unique. There's a need to create a POI MBtiles now to fully test this. |
When opening a POI that is off screen (like search and POI link) there's a need to get a POI by ID. I'm starting to think there's a need for two different databases - one for the POIs that can be tiled base, only to show the POIs on screen and a second one to allow getting a POI by ID. MBtiles database can do that assuming there are multiple tables, offline, and elastic can do it when online in the server side... |
OK, latest phone discussion:
|
…bulding of the slim geo-json POIs file.
…last modified date to external sources.
…oblem in iNature and geojson conversion
…ablity to create only the poi geojson file
… to use geojson file for offline use and site regular use.
An initial version was created which supports only showing the clustering when offline. The current experience of loading the geojson file is noticeable every time you open the app as you see the progress bar downloading the file - this is a bit wasteful in terms of network traffic and probably needs to be optimized using incremental update somehow. |
Latest changes: Moved away from using a file and create the clustering in the client side from the database when the app starts.
|
This seems to be happening on the server which causes a failure in databases rebuild :-( |
…uest, Added update of all sources to global update procedure.
The following scenarios need to be tested - it might be a good idea to add unit test for each scenario (if possible).
After each scenario above it would be best to check the OSM element in the OSM editor, The site and the app to see how it looks. The update is running every hour, on the hour, and takes about 15 minutes. Note to myself: |
When rebuilding the databases (external and OSM) the following scenario should be taken into consideration: |
The following scenario should be tested as well, Same as the scenario above only |
Hey @HarelM, i just visited you site: https://israelhiking.osm.org.il/map/12.53/31.4760/35.0611. Thanks, |
Hi @daniela-green, I hope this helps. |
Ok, sorry for the partially correct message I just wrote. I needed to read more in order to remember what I did. |
Hey @HarelM, thank you for your thorough reply! Can you explain more on how you manage to extract the data from a vector tile request and add it to a geojson? Thanks again, |
@daniela-green check out the following comment I wrote here: |
Just to clarify, I'm not doing anything with the network traffic. I let mapbox do all the heavy lifting of network traffic, caching and what not, and simply query the source from the map. This requires a "dummy" layer (which uses the source but doesn't draw anything on the map) to make sure mapbox uses the relevant source and loads its features. |
Got it, thank you for this great explanation! |
Infra
The following library might help, but I'm not sure how to utilize it correctly.
Loading a file/large data to memory every time the app starts can be annoying.
https://github.com/mapbox/geojson-vt
Also there's a way to check which network is currently being used here:
https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation
There's a question of how to update the data without downloading everything every time.
Relevant SO question:
https://stackoverflow.com/questions/58330896/how-to-index-geojson-data-in-browser-to-store-in-indexdb-using-geojson-vt
The text was updated successfully, but these errors were encountered: