Is it possible to write and save a KML from OpenLayers? Anyone know of an example of exporting one?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can export only the vector features to KML.
UPDATE
In order to force the browser to download the KML string as a KML file you need to send that string back to the server-side so it can be returned to the browser as a file to download.
You haven’t specified what language/platform/etc you are using on the server-side But this is what i did in C#.
I created a handler which takes in a the filename from the querystring and the KML from a textarea form.
KMLDownload.ashx:
Then from my javascript side i simply call this to initiate the download: