Skip to content

Commit

Permalink
update documentation with CDN support
Browse files Browse the repository at this point in the history
  • Loading branch information
arikw committed Aug 14, 2022
1 parent 83cc0c3 commit 598a379
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,47 @@ npm install itm-to-wgs84-converter
## Node

```js

// CommonJS
const converter = require('itm-to-wgs84-converter');
const ItmToWgs84Converter = require('itm-to-wgs84-converter');

// ES Module
import ItmToWgs84Converter from 'itm-to-wgs84-converter';
```

## Browser (CDN)

```js
// Classic
<script src="https://cdn.jsdelivr.net/gh/arikw/itm-to-wgs84-converter@1/src/index.js" />

// ES Module
import converter from 'itm-to-wgs84-converter';
import ItmToWgs84Converter from 'https://cdn.jsdelivr.net/gh/arikw/itm-to-wgs84-converter@1/dist/itm-to-wgs84-converter.browser.mjs';
```

# Usage Examples

```js
// ITM to WGS84
{
const [ latitude, longitude ] = converter.itm2wgs84(194140, 385060);
const [ latitude, longitude ] = ItmToWgs84Converter.itm2wgs84(194140, 385060);
// output: [29.553103541791266, 34.943293095766144]
}

// WGS84 to ITM
{
const [ east, north ] = converter.wgs842itm(29.553103541791266, 34.943293095766144);
const [ east, north ] = ItmToWgs84Converter.wgs842itm(29.553103541791266, 34.943293095766144);
// output: [194140, 385060]
}

// ICS to WGS84
{
const [ latitude, longitude ] = converter.ics2wgs84(144140, 885060);
const [ latitude, longitude ] = ItmToWgs84Converter.ics2wgs84(144140, 885060);
// output: [29.553036125579155, 34.943337203496604]
}

// WGS84 to ICS
{
const [ east, north ] = converter.wgs842ics(29.553036125579155, 34.943337203496604);
const [ east, north ] = ItmToWgs84Converter.wgs842ics(29.553036125579155, 34.943337203496604);
// output: [144140, 885060]
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "itm-to-wgs84-converter",
"version": "1.0.1",
"version": "1.0.2",
"description": "A Zero dependency ITM to WGS84 coordinates converter",
"author": "Arik W",
"license": "SEE LICENSE IN LICENSE.md",
Expand Down

0 comments on commit 598a379

Please sign in to comment.