Skip to content

Commit

Permalink
Merge pull request #4388 from camptocamp/profile-null
Browse files Browse the repository at this point in the history
Fix only null layer
  • Loading branch information
sbrunner committed Nov 20, 2018
2 parents 3b94f64 + 85eb6c0 commit f33ef9c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions contribs/gmf/src/profile/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,20 @@ exports.Controller_.prototype.getJsonProfile_ = function() {
exports.Controller_.prototype.getProfileDataSuccess_ = function(resp) {
const profileData = resp.data['profile'];
if (profileData instanceof Array) {
const nonempty_layers = [];
for (const d of profileData) {
for (const v in d['values']) {
if (nonempty_layers.indexOf(v) < 0 && d['values'][v] !== null) {
nonempty_layers.push(v);
}
}
}

this.profileOptions.linesConfiguration = {};
for (const layer of nonempty_layers) {
this.profileOptions.linesConfiguration[layer] = this.linesConfiguration_[layer];
}

this.profileData = profileData;
}
};
Expand Down

0 comments on commit f33ef9c

Please sign in to comment.