Lint free examples

This commit is contained in:
Tim Schaub
2016-01-09 16:31:58 -07:00
parent 0555bb081a
commit 8c38d22b60
64 changed files with 429 additions and 489 deletions

View File

@@ -35,6 +35,14 @@ var defaultStyle = new ol.style.Style({
stroke: defaultStroke
});
var flightsSource;
var addLater = function(feature, timeout) {
window.setTimeout(function() {
feature.set('start', new Date().getTime());
flightsSource.addFeature(feature);
}, timeout);
};
var pointsPerMs = 0.1;
var animateFlights = function(event) {
var vectorContext = event.vectorContext;
@@ -66,20 +74,13 @@ var animateFlights = function(event) {
map.render();
};
var addLater = function(feature, timeout) {
window.setTimeout(function() {
feature.set('start', new Date().getTime());
flightsSource.addFeature(feature);
}, timeout);
};
var flightsSource = new ol.source.Vector({
flightsSource = new ol.source.Vector({
wrapX: false,
attributions: [new ol.Attribution({
html: 'Flight data by ' +
'<a href="http://openflights.org/data.html">OpenFlights</a>,'
})],
loader: function(extent, resolution, projection) {
loader: function() {
var url = 'data/openflights/flights.json';
fetch(url).then(function(response) {
return response.json();
@@ -116,7 +117,7 @@ var flightsSource = new ol.source.Vector({
var flightsLayer = new ol.layer.Vector({
source: flightsSource,
style: function(feature, resolution) {
style: function(feature) {
// if the animation is still active for a feature, do not
// render the feature with the layer style
if (feature.get('finished')) {