mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
Merge pull request #30744 from cm-wada-yusuke/fix-ngeohash-parameter-types
[ngeohash] function 'encode' also accepts string latitude and longitude.
This commit is contained in:
Vendored
+1
-1
@@ -12,7 +12,7 @@ declare namespace ngeohash {
|
||||
type GeographicBoundingBox = [number, number, number, number];
|
||||
type NSEW = [number, number];
|
||||
|
||||
function encode(latitude: number, longitude: number, precision?: number): string;
|
||||
function encode(latitude: number | string, longitude: number | string, precision?: number): string;
|
||||
function decode(hashstring: string): GeographicPoint;
|
||||
function decode_bbox(hashstring: string): GeographicBoundingBox;
|
||||
function bboxes(minlat: number, minlon: number, maxlat: number, maxlon: number, precision?: number): Array<string>;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import geohash = require('ngeohash');
|
||||
|
||||
console.log(geohash.encode(37.8324, 112.5584));
|
||||
console.log(geohash.encode('37.8324', '112.5584'));
|
||||
// prints ww8p1r4t8
|
||||
|
||||
var latlon = geohash.decode('ww8p1r4t8');
|
||||
|
||||
Reference in New Issue
Block a user