DefinitelyTyped/types/utm/utm-tests.ts
Jonas Triki 29f705fd9b @types/utm - Make northern optional in toLatLon method (#37527)
* Make northern optional in toLatLon

* #37527 - Add overload to toLatLon

* #37527 - Add eofline to index.d.ts

* Update index.d.ts

* Update index.d.ts with newline

* #37527 - Remove double newline
2019-08-22 08:49:20 -07:00

23 lines
523 B
TypeScript

import { fromLatLon, toLatLon } from 'utm';
const latLon1 = {
lat: 37.240778,
lon: 131.869556,
};
const utmCoord1 = fromLatLon(latLon1.lat, latLon1.lon);
const latLon2 = toLatLon(
utmCoord1.easting,
utmCoord1.northing,
utmCoord1.zoneNum,
utmCoord1.zoneLetter,
);
const utmCoord2 = fromLatLon(latLon2.latitude, latLon2.longitude);
utmCoord1.easting === utmCoord2.easting;
utmCoord1.northing === utmCoord2.northing;
utmCoord1.zoneNum === utmCoord2.zoneNum;
utmCoord1.zoneLetter === utmCoord2.zoneLetter;