Lint free examples
This commit is contained in:
@@ -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')) {
|
||||
|
||||
Reference in New Issue
Block a user