open-location-code-typescript
Advanced tools
Comparing version
@@ -42,2 +42,3 @@ /** | ||
private static readonly CODE_PRECISION_EXTRA; | ||
private static readonly MAX_DIGIT_COUNT; | ||
private static readonly SEPARATOR_; | ||
@@ -44,0 +45,0 @@ private static readonly SEPARATOR_POSITION_; |
@@ -191,2 +191,3 @@ "use strict"; | ||
} | ||
codeLength = Math.min(OpenLocationCode.MAX_DIGIT_COUNT, codeLength); | ||
// Ensure that latitude and longitude are valid. | ||
@@ -233,3 +234,3 @@ let clippedLatitude = OpenLocationCode.clipLatitude(latitude); | ||
} | ||
const gridArea = OpenLocationCode.decodeGrid(editedCode.substring(OpenLocationCode.PAIR_CODE_LENGTH_)); | ||
const gridArea = OpenLocationCode.decodeGrid(editedCode.substring(OpenLocationCode.PAIR_CODE_LENGTH_, OpenLocationCode.MAX_DIGIT_COUNT)); | ||
return new CodeArea(codeArea.latitudeLo + gridArea.latitudeLo, codeArea.longitudeLo + gridArea.longitudeLo, codeArea.latitudeLo + gridArea.latitudeHi, codeArea.longitudeLo + gridArea.longitudeHi, codeArea.codeLength + gridArea.codeLength); | ||
@@ -542,2 +543,3 @@ } | ||
OpenLocationCode.CODE_PRECISION_EXTRA = 11; | ||
OpenLocationCode.MAX_DIGIT_COUNT = 15; | ||
// A separator used to break the code into two parts to aid memorability. | ||
@@ -544,0 +546,0 @@ OpenLocationCode.SEPARATOR_ = "+"; |
{ | ||
"name": "open-location-code-typescript", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Open Location Code Typescript implementation", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
169638
65.92%28
115.38%1875
105.14%