You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thanks for a great library! By looking at the source code, it seems like the updateTimeDimension = true will only work if the layer is set as queryable=1 in the getcapabilities. If it is set to 0, no times are returned. Is it somehow possible to bypass this and use updatetimedimension on non-queryable layers?
The text was updated successfully, but these errors were encountered:
A hack/workaround would be to replace the parsing function.
This is a copy of the original without the 'queryable' requirement :
let parseTimeDimensionFromCapabilitiesFix = function(xml) {
//// old selector
//// var layers = xml.querySelectorAll('Layer[queryable="1"]');
//// new selector
var layers = xml.querySelectorAll('Layer]');
var layerName = this._baseLayer.wmsParams.layers;
var layer = null, times = null;
layers.forEach(function(current) {
if (current.querySelector("Name").innerHTML === layerName)
layer = current;
})
if (layer) {
times = this._getTimesFromLayerCapabilities(layer);
if (!times)
times = this._getTimesFromLayerCapabilities(layer.parentNode);
}
return times;
}
Then replace the parser after creation :
let wmsTimeLayer = L.timeDimension.layer.wms( ... )
wmsTimeLayer._parseTimeDimensionFromCapabilities = parseTimeDimensionFromCapabilitiesFix;
Hi, thanks for a great library! By looking at the source code, it seems like the updateTimeDimension = true will only work if the layer is set as queryable=1 in the getcapabilities. If it is set to 0, no times are returned. Is it somehow possible to bypass this and use updatetimedimension on non-queryable layers?
The text was updated successfully, but these errors were encountered: