polyline-encoded
Advanced tools
Comparing version 0.0.6 to 0.0.7
{ | ||
"name": "Leaflet.encoded", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"homepage": "https://github.com/jieter/Leaflet.encoded", | ||
@@ -5,0 +5,0 @@ "authors": [ |
{ | ||
"name": "polyline-encoded", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Encoding and decoding of Google's polyline encoding format", | ||
@@ -5,0 +5,0 @@ "main": "Polyline.encoded.js", |
@@ -100,3 +100,3 @@ /* | ||
for (var d = 0; d < options.dimension; ++d, ++i) { | ||
numbers[i] = lastNumbers[d] = numbers[i] + (lastNumbers[d] || 0); | ||
numbers[i] = Math.round((lastNumbers[d] = numbers[i] + (lastNumbers[d] || 0)) * options.factor) / options.factor; | ||
} | ||
@@ -103,0 +103,0 @@ } |
@@ -11,3 +11,3 @@ 'use strict'; | ||
describe('PolyUtil', function () { | ||
var latlngs, encoded, encoded6, delta; | ||
var latlngs, encoded, encoded6, encoded5, delta; | ||
@@ -28,2 +28,3 @@ var floats, smallFloats, encodedFloats; | ||
encoded = '_p~iF~cn~U_ulLn{vA_mqNvxq`@'; | ||
encoded5 = 'ehukEveaqO|D~Laf@YiZw[oOgQqGeIqE_GeXu_@aOiKkCkMbGrDxIzF`Ct@~@L`FYhAMrNoFfEoArIwBvGwBvB}@jHcBnFcBz@g@jMsDzJ_DfEoAf@SRjCrDbQbBg@vB{@jCoArDg@bBfE|CvKtIbWrDrNvBnAvGfEvBjGqNzNcMtDgN`I_LpM'; | ||
encoded6 = '_izlhA~pvydF_{geC~{mZ_kwzCn`{nI'; | ||
@@ -86,2 +87,7 @@ | ||
it('should respect the precision in the decoded coordinates', function () { | ||
var decoded = polyUtil.decode(encoded5, 5); | ||
decoded[0].should.eql(decoded[decoded.length - 1]); | ||
}); | ||
it('integers with dimension = 1', function () { | ||
@@ -88,0 +94,0 @@ polyUtil.decodeUnsignedIntegers(encodedUnsignedIntegers) |
Sorry, the diff of this file is not supported yet
753546
665