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

doc update

parent d0d75fba
......@@ -31,38 +31,49 @@ Open browser on http://localhost:8080/demo
## Usage example
var map2 = L.map('map2').setView([ 58.5, 19.0 ], 5);
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom : 18,
attribution : '&copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors</a>'
}).addTo(map2);
var language = 'en';
var langData = {
"tTitle" : "Player"
};
var player = new L.Control.Player({
"lang" : language,
"langdata" : langData,
"position": 'bottomleft',
"display" : 'horizontal'
});
var player2 = new L.Control.Player({
"lang" : language,
"langdata" : langData,
"position": 'bottomleft',
"display" : 'horizontal'
});
map.addControl(player);
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>'
map2.addControl(player2);
function getBoundaryPointToLayer() {
return function (featureData, latlng) {
return L.circle(latlng, 2, {
color: '#000',
clickable: false
});
};
}
reqwest({
url: "output",
method: 'get',
type: 'json',
success: function (outputjson) {
var particleLayer = L.timeDimension.layer.geojsontime(JSON.parse(outputjson), {
cache: 10,
timeDimension: player2.getTimeDimension(),
duration: 'PT14M',
'pointToLayer': getBoundaryPointToLayer()
});
map2.addLayer(particleLayer);
player2.refresh();
}
});
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(weatherLayer1);
### Options
......
image.png

233 KB | W: | H:

image.png

153 KB | W: | H:

image.png
image.png
image.png
image.png
  • 2-up
  • Swipe
  • Onion skin
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