Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
stw
L.TimeDimension.layer.weather
Commits
28a67c5e
Commit
28a67c5e
authored
Nov 22, 2017
by
Soeren Laursen
Browse files
Added comment, remove debug code.
parent
159e28db
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/L.TimeDimension.layer.wms.FCOO.js
View file @
28a67c5e
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment