I want a button "export" as I clicked on it the shapefile should be downloaded along with it's all files shp, shx, prj, dbf as zip folder. My project is GIS based in which I have two main tasks:

  1. Import shapefile: shapefile to geojson, that is i am doing with the help of leafLet.
  2. Export shapefile: in this after draw/editing on map/layer/shapefile the duplicate shapefile should be created.

How I can export the copy of that particular shapefile?


1 Answer 1


There is no easy answer, but here is a general approach that might work (?)

  1. Import the shapefile (sounds like you have this working)
  2. Edit the layer with Leaflet Draw (as you already are doing)
  3. Save the changes as geojson object. See the draw:created and draw:edited callbacks
  4. Try this Mapbox library to export to shape and trigger download:

    shpwrite.download(geojson, options);


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.