mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 06:50:19 +00:00
@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
This commit is contained in:
committed by
Sheetal Nandi
parent
3ee2d884a4
commit
29f705fd9b
Vendored
+28
-15
@@ -1,27 +1,40 @@
|
||||
// Type definitions for utm 1.1
|
||||
// Project: https://github.com/timothygu/utm#readme
|
||||
// Definitions by: Hyeonsoo David Lee <https://github.com/civilizeddev>
|
||||
// Jonas Triki <https://github.com/JonasTriki>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export function fromLatLon(
|
||||
latitude: number,
|
||||
longitude: number,
|
||||
forceZoneNum?: number,
|
||||
latitude: number,
|
||||
longitude: number,
|
||||
forceZoneNum?: number,
|
||||
): {
|
||||
easting: number
|
||||
northing: number
|
||||
zoneNum: number
|
||||
zoneLetter: string
|
||||
easting: number;
|
||||
northing: number;
|
||||
zoneNum: number;
|
||||
zoneLetter: string;
|
||||
};
|
||||
|
||||
export function toLatLon(
|
||||
easting: number,
|
||||
northing: number,
|
||||
zoneNum: number,
|
||||
zoneLetter: string,
|
||||
northern: boolean,
|
||||
strict?: boolean,
|
||||
easting: number,
|
||||
northing: number,
|
||||
zoneNum: number,
|
||||
zoneLetter: string,
|
||||
northern?: undefined,
|
||||
strict?: boolean,
|
||||
): {
|
||||
latitude: number
|
||||
longitude: number
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
};
|
||||
|
||||
export function toLatLon(
|
||||
easting: number,
|
||||
northing: number,
|
||||
zoneNum: number,
|
||||
zoneLetter: undefined,
|
||||
northern: boolean,
|
||||
strict?: boolean,
|
||||
): {
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
};
|
||||
|
||||
@@ -8,11 +8,10 @@ const latLon1 = {
|
||||
const utmCoord1 = fromLatLon(latLon1.lat, latLon1.lon);
|
||||
|
||||
const latLon2 = toLatLon(
|
||||
utmCoord1.easting,
|
||||
utmCoord1.northing,
|
||||
utmCoord1.zoneNum,
|
||||
utmCoord1.zoneLetter,
|
||||
true,
|
||||
utmCoord1.easting,
|
||||
utmCoord1.northing,
|
||||
utmCoord1.zoneNum,
|
||||
utmCoord1.zoneLetter,
|
||||
);
|
||||
|
||||
const utmCoord2 = fromLatLon(latLon2.latitude, latLon2.longitude);
|
||||
|
||||
Reference in New Issue
Block a user