Openlayers write and save a KML based on your map

前端 未结 3 1648
时光说笑
时光说笑 2021-02-04 17:43

Is it possible to write and save a KML from OpenLayers? Anyone know of an example of exporting one?

3条回答
  •  攒了一身酷
    2021-02-04 18:02

    Here's some JQuery action to save:

    $('#saveKML').click(function() {
     var kmlFormat = new OpenLayers.Format.KML();
     var newWindow = window.open('', 
      'KML Export ' + (new Date()).getTime(), "width=300,height=300");
       newWindow.document.write('');
    });
    

提交回复
热议问题