I'm using MapServer + OpenLayers for GIS API and I'm new to GIS. I'm done with drawing line, point and polygon features in OpenLayers, but not being able to save it in some shapefile afterwards. I got to display the particular shapefile in map on click event. I have got no idea about how to do it.

Click here to see my code


OpenLayers runs in the browser, and does not provide a method for generating shapefiles.

What I would suggest is generating GeoJSON of your drawn featurres and POSTing that to the server, where you can use your language of choice to generate a shapefile from the GeoJSON.


Why don't you just save the edits to your wfs-t? If you don't have to use Mapserver you could for example use Geoserver to publish your services and save your edits and users could download the layer directly from Geoserver as shapefiles.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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