Hello, I'm making an app that involves the user pressing on a part of a map to zoom in to a specific county of Massachusetts in the US. I decided that using polygons to represent the counties was the way to approach this, since I can simply make it so that if the user presses on a county, which has an invisible polygon over it, the map pans to the polygon. However, I've found that the array for polygon borders of counties are extremely large to the point that I suspect the reason my app is crashing is because it simply can't process the amount. I would like some advice on solving this problem, or perhaps an alternative way to solve my original problem without using polygons.
Below is the csv file that contains the polygon coordinates.
Peter pointed out, the way to display the counties is to use a FeatureCollection
The csv file you attached has issues loading and is not a simple file showing only the polygon points. It contains extraneous information. . Find a Massachusetts json file with the counties and use a FeatureCollection to load them.
Here is a very basic example using Texas counties showing all the Blocks.
The TexasCounties json file is 176 kb. OSM has difficulty rendering files much larger than this sometimes
4. An issue you have is using LOTS of individual detailed polygons. OpenStreetMaps has difficulty rendering them. Using an file with fewer point should work for you.
5. Be patient when loading the FeatureCollection, it may take a minute or two.