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
leaflet-player-control
Commits
c9310e13
Commit
c9310e13
authored
Jun 27, 2017
by
Tomas Pettersson
🏸
Browse files
doc update
parent
d0d75fba
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
c9310e13
...
...
@@ -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 : '© <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 player
2
= 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
View replaced file @
d0d75fba
View file @
c9310e13
233 KB
|
W:
|
H:
153 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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