Commit 34fef643 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸
Browse files

refactor

parent b6f2a7bc
......@@ -40,34 +40,60 @@
var langData = {
"tTitle" : "Player"
};
var playerControl = new L.Control.Player({
var player = new L.Control.Player({
"lang" : language,
"langdata" : langData,
"position": 'bottomleft'
// ,"display" : 'horizontal'
});
map.addControl(playerControl);
map.addControl(player);
var wmsLayer = L.tileLayer.wms('http://wts.smhi.se/tile/', {
var timeDimension = player.getTimeDimension();
var wmsLayer1 = L.tileLayer.wms('http://wts.smhi.se/tile/', {
layers: "hiromb-BS01:oceancurrent-arrows_n-europe_4326_",
transparent: true,
crs: L.CRS.EPSG900913,
format: 'image/png',
zIndex: 900,
attribution: 'Current forecasts from <a href="http://www.smhi.se" alt="Swedish Meteorological Hydrological Institute">SMHI</a>'
});
var timeDimension = playerControl.getTimeDimension();
var weatherLayer = L.timeDimension.layer.wms.picasso(wmsLayer, {
var weatherLayer1 = L.timeDimension.layer.wms.picasso(wmsLayer1, {
proxy: 'proxy',
cache: 10,
timeDimension : timeDimension
});
weatherLayer1.on('metadataload', function(){
console.log('metadata loaded 1');
player.refresh();
});
map.addLayer(weatherLayer);
map.addLayer(weatherLayer1);
var wmsLayer2 = L.tileLayer.wms('http://wts.smhi.se/tile/', {
layers: "hiromb-BS01:oceancurrent-speed_n-europe_4326_",
transparent: true,
crs: L.CRS.EPSG900913,
format: 'image/png',
zIndex: 800,
attribution: 'Current forecasts from <a href="http://www.smhi.se" alt="Swedish Meteorological Hydrological Institute">SMHI</a>'
});
var weatherLayer2 = L.timeDimension.layer.wms.picasso(wmsLayer2, {
proxy: 'proxy',
cache: 10,
timeDimension : timeDimension
});
weatherLayer2.on('metadataload', function(){
console.log('metadata loaded 2');
player.refresh();
});
map.addLayer(weatherLayer2);
......
Supports Markdown
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