Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/haoliangyu/gtran-kmz
convert geojson to kmz file
https://github.com/haoliangyu/gtran-kmz
Last synced: about 1 month ago
JSON representation
convert geojson to kmz file
- Host: GitHub
- URL: https://github.com/haoliangyu/gtran-kmz
- Owner: haoliangyu
- License: mit
- Created: 2015-11-13T05:13:58.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-30T04:23:57.000Z (almost 9 years ago)
- Last Synced: 2024-10-08T06:05:58.128Z (about 1 month ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gtran-kmz
convert geojson to KMZ file
This is a sub-project of [gtran](https://github.com/haoliangyu/gtran).
## Installation
```javascript
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](https://github.com/haoliangyu/gtran-kml).
## Use Example
```javascript
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);
});```