[GIS] Speeding up large GeoJSONs in Leaflet maps

geojsonleafletvector-tiles

I am trying to use Leaflet to make a map which displays multiple projection boundaries, i.e. UTM, State Plane, MGRS. Right now I have three geojson files inside the javascript, but they are quite large and I want to add even more. I need to find a way to add all of these different layers while maintaining performance and speed. I'm not sure if that involves creating tiles or asynchronously loading the json files; either way I'm not sure how to do that. I could use some advice and/or links to resources and tutorials that may help.

Here is a link to my site and what already exists: http://www.paulcflynn.com/projection_picker.html

Best Answer

Loading multiple geojsons in an application is not a very good idea if you are looking for better performance and speed. You can convert your geojson files to topojson and then load them all asynchronously. Size of topojson files will be less as compared to geojson which will help you to maintain you speed and performance.

To convert geojson to topojson, you can use fwtools, here is the link

Here is an example of adding topojson to leaflet map: link