Make unmanaged vector layers behave more like ol.FeatureOverlay

* Skipped features need to be hit-detected on unmanaged layers.
* updateWhileAnimating and updateWhileInteracting are recommended to
  achieve the same instant visual feedback that ol.FeatureOverlay had.
This commit is contained in:
Andreas Hocevar
2015-06-19 13:06:29 +02:00
parent f74e4c95ff
commit f645a9e1e4
7 changed files with 20 additions and 9 deletions
+4 -2
View File
@@ -20,11 +20,13 @@ you will have to change this to:
var collection = new ol.Collection();
var featureOverlay = new ol.layer.Vector({
map: map,
style: overlayStyle,
source: new ol.source.Vector({
features: collection,
useSpatialIndex: false // optional, might improve performance
});
}),
style: overlayStyle,
updateWhileAnimating: true, // optional, for instant visual feedback
updateWhileInteracting: true // optional, for instant visual feedback
});
featureOverlay.getSource().addFeature(feature);
featureOverlay.getSource().removeFeature(feature);