Comparing version 1.0.0 to 1.0.1
16
index.js
@@ -7,3 +7,3 @@ // a tile is an array [x,y,z] | ||
var e = tile2lon(tile[0]+1,tile[2]); | ||
var w = tile2lon(tile[0],tile[2]); | ||
var w = tile2lon(tile[0],tile[2]); | ||
var s = tile2lat(tile[1]+1,tile[2]); | ||
@@ -18,3 +18,3 @@ var n = tile2lat(tile[1],tile[2]); | ||
type: 'Polygon', | ||
coordinates: | ||
coordinates: | ||
[ | ||
@@ -170,9 +170,7 @@ [ | ||
function pointToTileFraction(lon, lat, z) { | ||
var latr = lat*d2r, | ||
z2 = Math.pow(2, z); | ||
return [ | ||
(lon+180)/360*z2, | ||
(1-Math.log(Math.tan(latr) + 1/Math.cos(latr))/Math.PI)/2 *z2, | ||
z | ||
]; | ||
var sin = Math.sin(lat * d2r), | ||
z2 = Math.pow(2, z), | ||
x = z2 * (lon / 360 + 0.5), | ||
y = z2 * (0.5 - 0.25 * Math.log((1 + sin) / (1 - sin)) / Math.PI); | ||
return [x, y, z]; | ||
} | ||
@@ -179,0 +177,0 @@ |
{ | ||
"name": "tilebelt", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "simple tile utilities", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "tap test.js --cov" | ||
"test": "tap test.js --cov", | ||
"bench": "node bench.js" | ||
}, | ||
@@ -26,5 +27,5 @@ "repository": { | ||
"benchmark": "~1.0.0", | ||
"tap": "^1.2.0" | ||
"tap": "^1.3.4" | ||
}, | ||
"dependencies": {} | ||
} |
@@ -47,1 +47,7 @@ tilebelt | ||
``` | ||
## benchmarks | ||
```bash | ||
npm run bench | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27551
10
405
52