I'm using Mapbox with Leaflet for drawing, editing and removing polygons etc. I'm also using leaflet.shapefile to upload shapefiles and add them to the map.
For a certain application, I need to convert the layer to a GeoJSON object, which I then convert to a JSON string using this code:
var fcgeojson = layer.toGeoJSON();
var fcgeojsonstring = JSON.stringify(fcgeojson);
I have a working version of this in this jsfiddle. And for most of the shapefiles, it works just fine. However, in some cases, like when I use this shapefile, the JSON string of one of the polygons is actually incomplete. You can check out those strings by clicking on the "Test" button in the jsfiddle.
I haven't been able to figure out why this is happening (my guess is maybe the shapefile has too many vertices).