Giter Site home page Giter Site logo

gpx2czml's Introduction

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)

gpx2czml's People

Contributors

trustyoo86 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

chirag19 lemonjay

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.