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:
@@ -122,7 +122,9 @@ ol.interaction.Modify = function(options) {
|
||||
wrapX: goog.isDef(options.wrapX) ? options.wrapX : false
|
||||
}),
|
||||
style: goog.isDef(options.style) ? options.style :
|
||||
ol.interaction.Modify.getDefaultStyleFunction()
|
||||
ol.interaction.Modify.getDefaultStyleFunction(),
|
||||
updateWhileAnimating: true,
|
||||
updateWhileInteracting: true
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -178,7 +178,9 @@ ol.interaction.Select = function(opt_options) {
|
||||
wrapX: options.wrapX
|
||||
}),
|
||||
style: goog.isDef(options.style) ? options.style :
|
||||
ol.interaction.Select.getDefaultStyleFunction()
|
||||
ol.interaction.Select.getDefaultStyleFunction(),
|
||||
updateWhileAnimating: true,
|
||||
updateWhileInteracting: true
|
||||
});
|
||||
|
||||
var features = this.featureOverlay_.getSource().getFeaturesCollection();
|
||||
|
||||
@@ -160,10 +160,11 @@ ol.renderer.canvas.VectorLayer.prototype.forEachFeatureAtCoordinate =
|
||||
var resolution = frameState.viewState.resolution;
|
||||
var rotation = frameState.viewState.rotation;
|
||||
var layer = this.getLayer();
|
||||
var layerState = frameState.layerStates[goog.getUid(layer)];
|
||||
/** @type {Object.<string, boolean>} */
|
||||
var features = {};
|
||||
return this.replayGroup_.forEachFeatureAtCoordinate(coordinate,
|
||||
resolution, rotation, frameState.skippedFeatureUids,
|
||||
return this.replayGroup_.forEachFeatureAtCoordinate(coordinate, resolution,
|
||||
rotation, layerState.managed ? frameState.skippedFeatureUids : {},
|
||||
/**
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @return {?} Callback result.
|
||||
|
||||
@@ -184,10 +184,11 @@ ol.renderer.dom.VectorLayer.prototype.forEachFeatureAtCoordinate =
|
||||
var resolution = frameState.viewState.resolution;
|
||||
var rotation = frameState.viewState.rotation;
|
||||
var layer = this.getLayer();
|
||||
var layerState = frameState.layerStates[goog.getUid(layer)];
|
||||
/** @type {Object.<string, boolean>} */
|
||||
var features = {};
|
||||
return this.replayGroup_.forEachFeatureAtCoordinate(coordinate,
|
||||
resolution, rotation, frameState.skippedFeatureUids,
|
||||
return this.replayGroup_.forEachFeatureAtCoordinate(coordinate, resolution,
|
||||
rotation, layerState.managed ? frameState.skippedFeatureUids : {},
|
||||
/**
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @return {?} Callback result.
|
||||
|
||||
@@ -122,7 +122,8 @@ ol.renderer.webgl.VectorLayer.prototype.forEachFeatureAtCoordinate =
|
||||
context, viewState.center, viewState.resolution, viewState.rotation,
|
||||
frameState.size, frameState.pixelRatio,
|
||||
layerState.opacity, layerState.brightness, layerState.contrast,
|
||||
layerState.hue, layerState.saturation, frameState.skippedFeatureUids,
|
||||
layerState.hue, layerState.saturation,
|
||||
layerState.managed ? frameState.skippedFeatureUids : {},
|
||||
/**
|
||||
* @param {ol.Feature} feature Feature.
|
||||
* @return {?} Callback result.
|
||||
|
||||
Reference in New Issue
Block a user