Commit 28a67c5e authored by Soeren Laursen's avatar Soeren Laursen

Added comment, remove debug code.

parent 159e28db
......@@ -26,29 +26,28 @@ L.TimeDimension.Layer.WMS.FCOO = L.TimeDimension.Layer.WMS.extend({
}
this._capabilitiesRequested = true;
var url = this._getCapabilitiesUrl();
//if (this._proxy) {
// url = this._proxy + '?url=' + encodeURIComponent(url);
// }
$.get(url, (function(data) {
this._defaultTime = 0;
this._refTime = this._getRefTimeFromCapabilities(data);
this._setDefaultTime = this._setDefaultTime || (this._timeDimension && this._timeDimension.getAvailableTimes().length == 0);
var timeString = this._parseTimesFromCapabilities(data);
console.log("slnslnslsn");
var timeperiods = timeString.split(',');
var times = [];
// We do not need to iterate at the moment.
// for (var i = 0; i < timeperiods.length;i++) {
// var timeperiod = timeperiods[i].split('/');
// A small fix to add Z until the FCOO WMS service add it to all timestamps.
timeperiods[0] = timeperiods[0]+ "Z";
timeperiods[timeperiods.length-1] = timeperiods[timeperiods.length-1] + "Z"
// We take the first and the last timestamp
var startDate = moment(timeperiods[0], 'YYYY-MM-DDTHH:mm:SSZ');
var endDate = moment(timeperiods[timeperiods.length-1], 'YYYY-MM-DDTHH:mm:SSZ');
var hours = moment.duration(endDate.diff(startDate)).asHours()+1;
// var interval = moment.duration(timeperiod[2]).asHours();
//if (interval == 0) interval = 1;
var hours = moment.duration(endDate.diff(startDate)).asHours()+1;
// TO-DO: Might need a fix.
// Not sure about the interval
interval= 1;
for (var j = 0; j < hours; j+=interval) {
for (var j = 0; j < hours; j+=interval) {
var date = moment(startDate).add(j,"hours").valueOf();
times.push(date);
}
......@@ -101,9 +100,7 @@ L.TimeDimension.Layer.WMS.FCOO = L.TimeDimension.Layer.WMS.extend({
_parseTimesFromCapabilities: function(xml) {
var layers = $(xml).find('Layer[queryable="0"]');
var layers = $(xml).find('Layer');
console.log("sds" + layers );
var layerName= this._baseLayer.wmsParams.layers;
console.log("lllllll " + layerName);
var layerNameElement = layers.find("Name").filter(function(index) {
return $(this).text() === layerName;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment