Closed joebillings closed 5 years ago
I'm going to look into server side processing of the data to try and ease the strain, particularly on mobile devices.
This sounds quite different from loading the mimumum data necessary to display the map, leaving the othet data to be loaded, either after the map is created, or when required.
I'll continue looking but the problem doesn't seem to be the amount of data as a whole, it's the number of data points that's the issue.
Things to investigate:
Virtuoso now supports GeoSparql which would allow us to make location based queries that could ease the load. The only way to make this work would be to zoom in to a specific location when the app loads and request the inits from that area. The rest would get loaded as the user moves the map around. I'm not sure if this would work on the larger global datasets though.
Is https://github.com/Leaflet/Leaflet.markercluster the library we are currently using? From the documentation it doesn't look like ~9k inititiatves should cause performance issues.
Yeah that's the one.
https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.50000.html has 50k markers and it is lightening fast, so can't see how it could be the # of leaflet markers.
This is loading much faster now. I've moved the sorting to the server – the SPARQL query now sorts by country and then name. I've also moved the country name conversion to the sausage machine – previously the two character iso code was being passed through from the original data and then mapping to the the full name in the JS.
Other things that could potentially be improved:
Datasets larger than abut 4000 seem to suffer quite badly in almost all areas – loading, general moving around, selection.