Skip to content

Commit a81a5f5

Browse files
Solved 1-microdegree gap in a few spots on Earth, noticable now extreme precision is possible
1 parent 414a35b commit a81a5f5

File tree

5 files changed

+18351
-18335
lines changed

5 files changed

+18351
-18335
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ limitations under the License.
4444

4545
# Version History
4646

47+
* 2.2
48+
49+
Solved 1-microdegree gap in a few spots on Earth, noticable now extreme precision is possible
50+
4751
* 2.1.5
4852

4953
Reworked high-precision to pure integer math;

mapcode_api.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* limitations under the License.
1717
*/
1818

19-
define('mapcode_phpversion', '2.1.5');
19+
define('mapcode_phpversion', '2.2');
2020

2121
$xdivider19 = array(
2222
360, 360, 360, 360, 360, 360, 361, 361, 361, 361,
@@ -1343,9 +1343,7 @@ function master_decode($mapcode, $territoryNumber = -1) {
13431343
$zone = decodeGrid($mapcode, $extensionchars, $m);
13441344

13451345
// first of all, make sure the zone fits the country
1346-
if (! $zone->isEmpty() && ($territoryNumber != ccode_earth)) {
1347-
$zone = $zone->RestrictZoneTo(minmaxSetup($upto));
1348-
}
1346+
$zone = $zone->RestrictZoneTo(minmaxSetup($upto));
13491347

13501348
if (!$zone->isEmpty() && isRestricted($m)) {
13511349
$nrZoneOverlaps = 0;
@@ -1397,9 +1395,9 @@ function master_decode($mapcode, $territoryNumber = -1) {
13971395
break;
13981396
}
13991397
}
1400-
if ($territoryNumber != ccode_earth) {
1401-
$zone = $zone ->restrictZoneTo(minmaxSetup($upto));
1402-
}
1398+
1399+
$zone = $zone ->restrictZoneTo(minmaxSetup($upto));
1400+
14031401
if ($zone->isEmpty()) {
14041402
return 0;
14051403
}

0 commit comments

Comments
 (0)