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
2665dff3
Commit
2665dff3
authored
Mar 17, 2016
by
Tomas Pettersson
🏸
Browse files
cache
parent
0fcd44f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/L.TimeDimension.layer.wms.picasso.js
View file @
2665dff3
L
.
TimeDimension
.
Layer
.
WMS
.
Picasso
=
L
.
TimeDimension
.
Layer
.
WMS
.
extend
({
initialize
:
function
(
layer
,
options
)
{
L
.
TimeDimension
.
Layer
.
WMS
.
prototype
.
initialize
.
call
(
this
,
layer
,
options
);
this
.
_refTime
=
0
;
},
_getCapabilitiesUrl
:
function
()
{
var
url
=
this
.
_baseLayer
.
getURL
();
if
(
this
.
_baseLayer
.
wmsParams
.
layers
)
url
+=
this
.
_baseLayer
.
wmsParams
.
layers
;
...
...
@@ -46,6 +49,9 @@ L.TimeDimension.Layer.WMS.Picasso = L.TimeDimension.Layer.WMS.extend({
if
(
this
.
_setDefaultTime
&&
this
.
_timeDimension
)
{
this
.
_timeDimension
.
setCurrentTime
(
this
.
_defaultTime
);
}
if
(
times
.
length
>
0
)
{
this
.
fire
(
'
metadataload
'
);
}
}).
bind
(
this
));
},
...
...
@@ -53,6 +59,14 @@ L.TimeDimension.Layer.WMS.Picasso = L.TimeDimension.Layer.WMS.extend({
this
.
_availableTimes
=
times
;
this
.
_updateTimeDimensionAvailableTimes
();
},
// Player specific function: get available times to be used in player
getPlayerTimes
:
function
()
{
return
this
.
_availableTimes
;
},
// Player specific function: should this layer available times be forced over other layers available times in player
forcePlayerTimes
:
function
()
{
return
false
;
},
_getRefTimeFromCapabilities
:
function
(
xml
)
{
var
layers
=
$
(
xml
).
find
(
'
Layer[queryable="0"]
'
);
...
...
@@ -105,8 +119,22 @@ L.TimeDimension.Layer.WMS.Picasso = L.TimeDimension.Layer.WMS.extend({
}
return
times
;
},
getEvents
:
function
(){
var
clearCache
=
L
.
bind
(
this
.
clear
,
this
);
return
{
moveend
:
clearCache
,
zoomend
:
clearCache
}
},
clear
:
function
()
{
for
(
var
prop
in
this
.
_layers
)
{
delete
this
.
_layers
[
prop
];
}
},
_getLayerForTime
:
function
(
time
)
{
if
(
time
==
0
||
time
==
this
.
_defaultTime
||
time
==
null
)
{
if
(
time
==
0
||
time
==
this
.
_defaultTime
||
time
==
null
||
this
.
_refTime
==
0
)
{
return
this
.
_baseLayer
;
}
if
(
this
.
_layers
.
hasOwnProperty
(
time
))
{
...
...
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