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>

Readme

Keywords

Package Sidebar

Install

npm i dji-kmz-parser

Weekly Downloads

4

Version

1.2.9

License

MIT

Unpacked Size

293 kB

Total Files

5

Last publish

Collaborators

  • spinacia_