From aaced2fe1bf886212d31a2943b4c8f848227c52f Mon Sep 17 00:00:00 2001 From: "julien.waddle@camptocamp.com" Date: Tue, 18 Sep 2018 12:18:51 +0200 Subject: [PATCH 1/2] On kml import force the use of default style --- contribs/gmf/src/datasource/ExternalDataSourcesManager.js | 2 +- examples/importfeatures.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/contribs/gmf/src/datasource/ExternalDataSourcesManager.js b/contribs/gmf/src/datasource/ExternalDataSourcesManager.js index b7cd4cfaec91..c0f0327a98cd 100644 --- a/contribs/gmf/src/datasource/ExternalDataSourcesManager.js +++ b/contribs/gmf/src/datasource/ExternalDataSourcesManager.js @@ -532,7 +532,7 @@ const exports = class { }; if (ngeoFile.isKml(content)) { - features = new olFormatKML().readFeatures(content, readOptions); + features = new olFormatKML({extractStyles: false}).readFeatures(content, readOptions); } else if (ngeoFile.isGpx(content)) { features = new olFormatGPX().readFeatures(content, readOptions); } diff --git a/examples/importfeatures.js b/examples/importfeatures.js index bce3340b1014..e46546e5e6c7 100644 --- a/examples/importfeatures.js +++ b/examples/importfeatures.js @@ -39,7 +39,9 @@ exports.MainController = function($scope) { * @private * @type {ol.format.KML} */ - this.kmlFormat_ = new olFormatKML(); + this.kmlFormat_ = new olFormatKML({ + extractStyles: false + }); /** * @private From 44912e33f3a67076e09964412ee77fe30beb8951 Mon Sep 17 00:00:00 2001 From: "julien.waddle@camptocamp.com" Date: Tue, 18 Sep 2018 12:11:25 +0200 Subject: [PATCH 2/2] Set nodata values to null and not 0 --- contribs/gmf/src/profile/component.js | 2 +- src/profile/d3Elevation.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/contribs/gmf/src/profile/component.js b/contribs/gmf/src/profile/component.js index c60cfa4ea8da..381a25ac5700 100644 --- a/contribs/gmf/src/profile/component.js +++ b/contribs/gmf/src/profile/component.js @@ -608,7 +608,7 @@ exports.Controller_.prototype.getZFactory_ = function(layerName) { if ('values' in item && layerName in item['values']) { return parseFloat(item['values'][layerName]); } - return 0; + return null; }; return getZFn; }; diff --git a/src/profile/d3Elevation.js b/src/profile/d3Elevation.js index 333e55d89951..34990343c4b6 100644 --- a/src/profile/d3Elevation.js +++ b/src/profile/d3Elevation.js @@ -407,7 +407,9 @@ const exports = function(options) { // Configure the d3 line. line = d3.line() .x(d => x(distanceExtractor(d))) - .y(d => y(linesConfiguration[name].zExtractor(d))); + .y(d => y(linesConfiguration[name].zExtractor(d))) + .defined(d => d.value !== null); + // Update path for the line. g.select(`.line.${name}`)