tl;dr version: How do we build a fast choropleth map with MapBox GL?
@RyanBaumann posted an example: See https://ryanbaumann.squarespace.com/blog/2016/1/23/mapbox-gl-create-data-driven-styles
But this example shows loading GeoJSON files directly in javascript. One question about how to handle large GeoJSON files. Let's say you have a 18M GeoJSON file. And you want to view a map and Data-Driven Styles and do it all efficiently.
For example, I have loaded a large GeoJSON file:
https://cityregister.firebaseapp.com/recentsaleslocal.geojson
in this mapbox style:
and it loads instantly and does not transfer the entire 18M over the network at load time.
But when I use the approach Ryan is showing, it appears that I have to load the entire 18M file over the network at load time. That is much slower especially on a slow network.
I'd like to know is there a way to have data-driven styles AND a base map from mapbox all on the same map?
Here are a few examples:
https://cityregister.firebaseapp.com/map.html (loads instantly, has base map, all resides on mapbox studio server. NO data-driven style
https://cityregister.firebaseapp.com/testmapboxlayerchoropleth.html (loads very slowly, has base map, base map on mapbox, geojson on another server. Uses data-driven style https://cityregister.firebaseapp.com/testmapboxlayerchoropleth.html (loads instantly, NO base map, seems to be all mapbox-gl generated, Uses data-driven style.
My question is how to get the speed of mapbox AND the data-driven styles AND a base map with streets, etc.
Thanks.
pictures of maps above.
fast nyc map but not data-driven
fast nyc choropleth but no base map
slow choropleth loads 18M over network