mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* 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
23 lines
523 B
TypeScript
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;
|