gbif / hp-swiss-bif

0 stars 0 forks source link

Custom map lagging when zooming in and out #3

Closed giannijacot closed 1 week ago

giannijacot commented 4 months ago

We managed to add the Swiss map using Mapbox and similar parameters to another application we are developing (see config.js). It's working well but the map is sometimes freezing when zooming in and out (even with only one occurence displayed). You can see it here : https://swiss-bif.hp.gbif-staging.org/en/occurrence/search?catalogNumber=karch-AMPH-234971&view=MAP

We already checked some parameters on Mapbox and the Swiss map API and it doesn't seem to come from here.

Do you know if something could be done to reduce lag ?

I'm mainly using Google chrome to browse the hosted portal.

MortenHofft commented 4 months ago

Openlayers aren't as fast as mapbox. Perhaps change to use that instead? (you are currently using openlayers)

I also notice that the tiles are quite large, 1.3mb for some of them. That is a fair bit larger than what is normal as far as I know. For comparison I didn't managed to find a single mapbox tile above 70kb fro a bit of random browsing

MortenHofft commented 4 months ago

I've changed the config to use mapbox - that helped. https://github.com/gbif/hp-swiss-bif/commit/348a233b820d6cd8f49b02fb3416b2a5e46d9482

But it would probably be a good idea to reduce tile sizes (kb) as well.

MortenHofft commented 4 months ago

The map looks nice btw. Especially now that it renders fast with mapbox.

giannijacot commented 4 months ago

Thanks for the change and the advice ! The rendering time is much better.

I will check if there is also a way to reduce tile size.