From 82d447629e653e7a8004ad9f9b5755214e4d9ddc Mon Sep 17 00:00:00 2001 From: Pascal Barth Date: Mon, 9 Mar 2020 13:55:45 +0100 Subject: [PATCH] Profile cleanup integration (#4993) * Smoothing of profile done with D3, and profile asked with offest=0 * Adapting test to offset=0 * Adding new param, removing smoothing as its not useful anymore as smart filling will not need smoothing * fixing test with new param --- src/components/profile/ProfileService.js | 3 ++- test/specs/profile/ProfileService.spec.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/profile/ProfileService.js b/src/components/profile/ProfileService.js index 00ada630b1..aee3d4a9f0 100644 --- a/src/components/profile/ProfileService.js +++ b/src/components/profile/ProfileService.js @@ -296,7 +296,8 @@ goog.require('ga_urlutils_service'); var data = $.param({ geom: wkt, elevation_models: elevationModel, - offset: 1 + offset: 0, + smart_filling: true }); var config = { diff --git a/test/specs/profile/ProfileService.spec.js b/test/specs/profile/ProfileService.spec.js index efd13ba769..8ffed9ef48 100644 --- a/test/specs/profile/ProfileService.spec.js +++ b/test/specs/profile/ProfileService.spec.js @@ -158,7 +158,7 @@ describe('ga_profile_service', function() { var spy = sinon.spy($http, 'post'); gaProfile.create(feature); expect(spy.callCount).to.be(1); - expect(spy.args[0][1]).to.be('geom=%7B%22type%22%3A%22LineString%22%2C%22coordinates%22%3A%5B%5B0.0%2C0.0%5D%2C%5B1.0%2C0.0%5D%2C%5B1.0%2C1.0%5D%5D%7D&elevation_models=COMB&offset=1'); + expect(spy.args[0][1]).to.be('geom=%7B%22type%22%3A%22LineString%22%2C%22coordinates%22%3A%5B%5B0.0%2C0.0%5D%2C%5B1.0%2C0.0%5D%2C%5B1.0%2C1.0%5D%5D%7D&elevation_models=COMB&offset=0&smart_filling=true'); var config = spy.args[0][2]; expect(config.cache).to.be(true); expect(config.timeout).to.be.a(Object);