JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 229
  • Score
    100M100P100Q83553F
  • License MIT

convert kmz to json

Package Exports

  • dji-kmz-parser
  • dji-kmz-parser/lib/index.js
  • dji-kmz-parser/lib/index.umd.cjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dji-kmz-parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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>