I'm working in an Angular 2 v4 webapp and I need to generate a KML file with the data of an array that I get from my REST. The response of my REST is something like this:
[
{ "lat": 14.05891566, "lng": -19.9981566 },
{ "lat": 14.05668566, "lng": -19.9566123 },
{ "lat": 14.05567413, "lng": -19.9467456 },
{ "lat": 14.05455655, "lng": -19.9367125 }
...
]
the REST just response that array of coordinates
How can I generate a KML file with that data and then download the file .kml?
If possible, I am looking for a node module that allows me to do this, but if it does not exist, what would be the correct way to do it?