npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gpx2czml

v1.0.6

Published

gpx to czml converter module

Downloads

26

Readme

gpx2czml

Build Status

gpx2czml is updated 1.0.0. previous version is deprecated.

javascript gpx to czml data convert module

개요(Summary)

이 모듈은 gpx 데이터를 czml 데이터로 변환해주는 javascript 모듈입니다. This module is a javascript module that converts gpx data to czml data.

czml로 변환한 데이터는 Cesium.js에 활용될 수 있습니다. The data converted to czml can be used for Cesium.js.

설치(Setup)

Browser Support

  • IE : 10+
  • Chrome, Firefox, Safari

HTML

<script src="path/to/gpx2czml.js"></script>

npm or common js

$npm install gpx2czml

javascript install

//pure javascript
var gpx2czml = require('gpx2czml');

사용법(Usage)

gpx2czml.js

gpx2czml.js를 사용하여 gpx를 czml로 컨버팅 하기 위해서는 두가지 방법으로 사용하실 수 있습니다. There are two ways to convert gpx to czml using gpx2czml.js.

1) asyncFromAjax

http request를 통해서 gpx를 czml로 변환하실 수 있습니다. 변환하는 방법은 url 및 callback function을 통해서 가능합니다. You can do this through the url and callback functions.

gpx2czml.asyncFromAjax('your http request path', function (isError, result) {
  if (isError) {

  } else {
    //czml object data result
    console.log('result is : ', result);
  }
});

async function에서 사용되는 파라미터는 다음과 같습니다. The parameters used in the async function are as follows

  • url : 호출하고자 하는 http url The http url you want to call

callback function에서 반환되는 파라미터는 다음과 같습니다. The parameters returned by the callback function are:

  • isError : 에러 여부, 처리 과정 중에 에러가 발생하면 true로 반환됩니다. If an error occurs during processing, it is returned as true.

  • result : 에러가 나지 않는다면, czml JSON object를 반환합니다. If there are no errors, the czml JSON object is returned.

2) asyncFromFile

input file 태그를 사용하여 gpx 파일을 업로드 하여 사용하실 수 있습니다. 사용 방법은 다음과 같습니다. You can use gpx2czml using input tag. Here is usage that use input tag.

HTML
<input type="file" onchange="handleEvent(event)"/>
javascript
function handleEvent(e) {
  gpx2czml.asyncFromFile(e, function (isError, czml) {
    if (isError) {

    } else {
      //czml object data result
      console.log('result is : ', result);
    }
  });
}

사용되는 파라미터는 async function과 동일합니다. The parameters used are the same as the async function.

문의 (Contact)