问题
I currently have a section on my website where I ask users to input information on various criteria and the answers get emailed to me (a form with submit button). I would like to add a map to the form in which users can draw shapes such as polygons and circles. Once they submit the form, I would like the map to be emailed along with the other input criteria to me. What is the best code to use?Thank you.
回答1:
Never too late ...
You can let the browser open a mail client and send the shapes in the body of the mail.
var text=JSON.stringify(drawnItems.toGeoJSON());
window.open('mailto:test@example.com?subject=subject&body=' + text);
Here is a full example
来源:https://stackoverflow.com/questions/29831140/map-added-to-form-with-ability-to-add-polygons-and-submit-via-email