From 49cb77ac8f734e05b01608af4cbda7ebd7384756 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Sat, 2 Jul 2016 18:45:03 +0100 Subject: [PATCH] Do stuff while animating/interacting. --- public_html/script.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/public_html/script.js b/public_html/script.js index 86bfb5c..9b3a6c6 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -353,15 +353,27 @@ function initialize_map() { }); var staticLayer = new ol.layer.Vector({ - source: new ol.source.Vector({features: StaticFeatures}) + source: new ol.source.Vector({ + features: StaticFeatures, + updateWhileInteracting: true, + updateWhileAnimating: true + }) }); var trailsLayer = new ol.layer.Vector({ - source: new ol.source.Vector({features: PlaneTrailFeatures}) + source: new ol.source.Vector({ + features: PlaneTrailFeatures, + updateWhileInteracting: true, + updateWhileAnimating: true + }) }); var iconsLayer = new ol.layer.Vector({ - source: new ol.source.Vector({features: PlaneIconFeatures}) + source: new ol.source.Vector({ + features: PlaneIconFeatures, + updateWhileInteracting: true, + updateWhileAnimating: true + }) }); OLMap = new ol.Map({ @@ -374,7 +386,9 @@ function initialize_map() { controls: [new ol.control.Zoom(), new ol.control.Rotate(), new ol.control.Attribution(), - new ol.control.ScaleLine({units: Metric ? "metric" : "nautical"})] + new ol.control.ScaleLine({units: Metric ? "metric" : "nautical"})], + loadTilesWhileAnimating: true, + loadTilesWhileInteracting: true }); // Listeners for newly created Map