Commit b6f2a7bc authored by Tomas Pettersson's avatar Tomas Pettersson 🏸
Browse files

new strat

parent 92849468
......@@ -15,7 +15,7 @@
},
"dependencies": {
"leaflet": "https://github.com/Leaflet/Leaflet.git#v1.0.0-beta.2",
"leaflet-tilelayer-wms-picasso": "https://git.smhi.se/stw/leaflet-tilelayer-wms-picasso.git",
"leaflet-timedimension-weather": "https://git.smhi.se/stw/L.TimeDimension.layer.weather.git",
"jquery": "latest",
"ion.rangeSlider": "latest",
"reqwest" : "https://github.com/ded/reqwest.git",
......
......@@ -25,7 +25,7 @@
<script src="../bower_components/ion.rangeSlider/js/ion.rangeSlider.min.js"></script>
<script src="../bower_components/iso8601-js-period/iso8601.min.js"></script>
<script src="../bower_components/leaflet-timedimension/dist/leaflet.timedimension.src.withlog.js"></script>
<script src="../bower_components/leaflet-tilelayer-wms-picasso/src/leaflet-tilelayer-wms-picasso.js"></script>
<script src="../bower_components/leaflet-timedimension-weather/src/L.TimeDimension.layer.wms.picasso.js"></script>
<script src="../src/leaflet-player-control.js"></script>
<script>
......@@ -36,30 +36,10 @@
attribution : '&copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors</a>'
}).addTo(map);
var metadata = {
proxy: 'proxy'
};
var wmsParams = {
layers: "hiromb-BS01:oceancurrent-arrows_n-europe_4326_",
transparent: true,
crs: L.CRS.EPSG900913
};
var options = {
attribution: 'Current forecasts from <a href="http://www.smhi.se" alt="Swedish Meteorological Hydrological Institute">SMHI</a>',
zIndex: 900
};
var layer = new L.TileLayer.WMS.Picasso(metadata, wmsParams, options);
layer.on('metadataload', function(){
map.addLayer(layer);
});
var language = 'en';
var langData = {
"tTitle" : "Player"
};
var playerControl = new L.Control.Player({
"lang" : language,
"langdata" : langData,
......@@ -68,6 +48,28 @@
});
map.addControl(playerControl);
var wmsLayer = 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',
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, {
proxy: 'proxy',
cache: 10,
timeDimension : timeDimension
});
map.addLayer(weatherLayer);
</script>
</body>
......
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