perfectly-preserved-pie / larentals

An interactive map of for-sale & rental property listings in Los Angeles County, updated weekly.
https://wheretolive.la
15 stars 3 forks source link

Large GeoJSON files: Additional layers are causing slowdowns #216

Open perfectly-preserved-pie opened 3 months ago

perfectly-preserved-pie commented 3 months ago

The crime and oil well GeoJSONs are pretty big:

The browser has to fetch an additional ~38MB of data which is causing the pages to render slowly upon initial load... but once they do, everything is pretty fast again. Still, I need to find a way to reduce the GeoJSON size.

I've disabled these layers in prod for now because speed is more important than anything. If it's not quick no one will bother using the website.

perfectly-preserved-pie commented 3 months ago

I've been thinking about this and there has to be a way to lazy-load these datasets. I only want them to load when a user ticks the checkbox inside the LayersControl object; it should be so obvious...

That would keep the performance the same and only drop it when a user consciously takes action to load the layer.