@rbzhang/gtran-kmz

1.1.5 • Public • Published

gtran-kmz

convert geojson to KMZ file

This is a sub-project of gtran.

Installation

npm install gtran-kmz

Functions

  • setPromiseLib(object)

    Specify the promise library. If not, the library will use the native Promise.

  • fromGeoJson(geojson, fileName, options)

    Save the geojson into the given file name.

    options:

    • symbol - Symbol of saved features. See detail at gtran-kml.

Use Example

var kmz = require('gtran-kmz');

var pointSymbol = {
    color: '#2dcd86',
    alpha: 255,
    scale: 1,
    icon: 'http://maps.google.com/mapfiles/kml/shapes/square.png'
};

// if specific promise library is needed
kmz.setPromiseLib(require('bluebird'));

// Save geojson into KMZ file
kmz.fromGeoJson(geojson, 'point.kmz', {
    symbol: pointSymbol,
    name: 'Name'
})
.then(function(fileName) {
    console.log('KMZ file has been saved at:' + fileName);
});

Dependencies (2)

Dev Dependencies (4)

Package Sidebar

Install

npm i @rbzhang/gtran-kmz

Weekly Downloads

0

Version

1.1.5

License

MIT

Unpacked Size

6.38 kB

Total Files

6

Last publish

Collaborators

  • rbzhang