technologiestiftung/giessdenkiez-de

should all the trees be loaded at once

Closed this issue · 6 comments

Background: Why this issue?

  • loading time and resource consumption is rather high. The file is about 8mb

Deliverables: How to fix the issue?

  • I think the loading times can be improved using tiling for the trees.

Output: Gain of fixing the issue?

  • better user experience, compatibility with phones and better loading times.

Hi @jucajuca Sorry for the delay.

Do you have an alternative idea how we could display all the trees at once on startup? The application starts pretty far zoomed out. So tiling is not an option here.

On mobile the trees are coming in from Mapbox as Vector Layer and are only loaded when the tile comes into the view (I think).

Currently the application is in maintenance mode for us. We don't have the time to invest a lot of developer-time to it.


Improvements in form of Pull Requests are very welcome. If you plan to do a PR please consult us before hand.

You can also generate the tilesets with less resolution at lower zoom levels.

I just converted the file to a vector tileset:
https://tiles2.juan-carlos.info/services/berlin-trees/map

It loads definitely faster than the whole tree file. More trees are loaded as the zoom is increased.

@jucajuca But that would mean to rewrite to whole interaction we have on the current GeoJsonLayer in the map, right?

I like your idea but we don't have the resources right now. As I said a PR would be welcome.

I don't think so because this would be a vector layer, just that it is loaded efficiently. The features remain the same with the same ids. I just had to adjust the "age" column and fill empty cells with zeroes.

@jucajuca can you give me access to your source code so I can have a closer look?

Is it really necessary to display the trees when opening the website? In a desktop browser the map displays more or less the whole area of Berlin. One sees only thin stripes and small areas of trees. IMHO the most common use case is to zoom into a specific area of the town as first step of using the map and then selecting single trees. Displaying the trees is IMHO therefore only relevant when one is able to distinguish one tree from another as single dots on the map.

So the initial loading time would be considerable faster (not loading the trees on the whole-town-map and waiting several seconds) and only the relevant portion of trees (a few hundreds to thousands but not over a half million) have to be loaded on a zoomed in section of the map.