Assume a latitude, longitude order for Polyline format

This commit is contained in:
Frederic Junod
2014-10-31 11:47:44 +01:00
parent afe1467ddf
commit 83025fb97d
2 changed files with 17 additions and 4 deletions

View File

@@ -17,7 +17,10 @@ describe('ol.format.Polyline', function() {
flatPoints = [-120.20000, 38.50000,
-120.95000, 40.70000,
-126.45300, 43.25200];
encodedFlatPoints = '~ps|U_p~iFnnqC_ulLvxq`@_mqN';
flippedFlatPoints = [38.50000, -120.20000,
40.70000, -120.95000,
43.25200, -126.45300];
encodedFlatPoints = '_p~iF~ps|U_ulLnnqC_mqNvxq`@';
points3857 = [
ol.proj.transform([-120.20000, 38.50000], 'EPSG:4326', 'EPSG:3857'),
ol.proj.transform([-120.95000, 40.70000], 'EPSG:4326', 'EPSG:3857'),
@@ -42,7 +45,7 @@ describe('ol.format.Polyline', function() {
it('returns expected value', function() {
var encodeDeltas = ol.format.Polyline.encodeDeltas;
expect(encodeDeltas(flatPoints, 2)).to.eql(encodedFlatPoints);
expect(encodeDeltas(flippedFlatPoints, 2)).to.eql(encodedFlatPoints);
});
});
@@ -50,7 +53,7 @@ describe('ol.format.Polyline', function() {
it('returns expected value', function() {
var decodeDeltas = ol.format.Polyline.decodeDeltas;
expect(decodeDeltas(encodedFlatPoints, 2)).to.eql(flatPoints);
expect(decodeDeltas(encodedFlatPoints, 2)).to.eql(flippedFlatPoints);
});
});