This is a small script to handle a shp file and transform it to GeoJSON.
I could say it is based on, but it is almost complete copy of shapefile-js by RandomEtc. I just re-organised the code and added a small function to transform it.
So far, only Polygons
are supported but implementing Points
and Lines
shouldn't be a problem.
I use this for my personal projects, specifically to handle shape files directly in the browser and visualise them with mapbox-gl.
Check the demo for details on how to use it.