Skip to content

Commit

Permalink
Merge pull request #3208 from Geoportail-Luxembourg/fix_esri_time_layer
Browse files Browse the repository at this point in the history
add the layer even if the time parameter is not specified
  • Loading branch information
rmichaelis authored Dec 11, 2024
2 parents 64cfe58 + 7637227 commit 8976b17
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,16 @@ exports.prototype.applyLayerStateToMap_ = function(layerIds, opacities, times, f
layer.set('current_time', times[layerIndex])
// use min and max default values to restore previous state
let time = layer.get('time');
const default_times = times[layerIndex].split("/");
time.minDefValue = default_times[0];
if (default_times.length > 1 ) {
time.maxDefValue = default_times[1];
if (time !== undefined) {
const default_times = times[layerIndex].split("/");
time.minDefValue = default_times[0];
if (default_times.length > 1 ) {
time.maxDefValue = default_times[1];
}
layer.set('time', time);
} else {
console.log("Layer has no time information defined")
}
layer.set('time', time);
}
}
// Skip layers that have already been added
Expand Down

0 comments on commit 8976b17

Please sign in to comment.