dji-kmz-parser

1.2.9 • Public • Published

Dji-kmz-parser

Usage

pnpm add dji-kmz-parser
  1. kmzToJson

    Convert KMZ file (with Blob format) to JSON.

    <script setup lang="ts">
    import kmzFile from '/files/flight.kmz?url'
    import { kmzToJson } from 'dji-kmz-parser/lib'
    
    fetch(kmzFile)
    	.then(async (res: Response) => {
    		const obj = await kmzToJson(res)
    		console.log(obj)
    	})
    	.catch((err: string) => console.log(err))
    </script>
  2. jsonToKmz

    Convert JSON to KMZ file.

    <script setup lang="ts">
    import flightObj from '/files/flightObj.ts'
    import { jsonToKmz } from 'dji-kmz-parser/lib'
    
    jsonToKmz(flightObj).then((res: Blob) => {
        const a = document.createElement('a')
        a.href = window.URL.createObjectURL(res)
        a.download = 'flight.kmz'
        a.click()
    }).catch((err: string) => console.log(err))
    </script>

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.2.92latest

Version History

VersionDownloads (Last 7 Days)Published
1.2.92
1.2.80
1.2.70
1.2.60
1.2.51
1.2.40
1.2.30
1.2.20
1.2.10
1.2.00
1.1.00
1.0.00

Package Sidebar

Install

npm i dji-kmz-parser

Weekly Downloads

3

Version

1.2.9

License

MIT

Unpacked Size

293 kB

Total Files

5

Last publish

Collaborators

  • spinacia_