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:
Mine Starks
2018-11-28 19:34:31 -08:00
committed by GitHub
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -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
View File
@@ -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');