js-kml-parser
v1.0.2
Published
Simple parser for kml files that can be used in client side Javascript. Use the parser to get a GeoJSON object representation from the kml file content.
Downloads
839
Maintainers
Readme
Client side helper to read .kml files content and parse their content as GeoJSON.
Install
npm install js-kml-parser
or yarn add js-kml-parser
How to use
import kmlParser from 'js-kml-parser';
const file = document.getElementById("kml-file").files[0];
const reader = new FileReader();
reader.onload = () => {
const geoJson = kmlParser.toGeoJson(reader.result);
console.log(geoJson);
}