Get rid of ol.FeatureOverlay
This also introduces a wrapX option to the Draw, Modify and Select interaction.
This commit is contained in:
@@ -77,7 +77,6 @@ ol.renderer.canvas.VectorLayer.prototype.composeFrame =
|
||||
function(frameState, layerState, context) {
|
||||
|
||||
var extent = frameState.extent;
|
||||
var focus = frameState.focus;
|
||||
var pixelRatio = frameState.pixelRatio;
|
||||
var skippedFeatureUids = layerState.unmanaged ?
|
||||
{} : frameState.skippedFeatureUids;
|
||||
@@ -109,20 +108,11 @@ ol.renderer.canvas.VectorLayer.prototype.composeFrame =
|
||||
// see http://jsperf.com/context-save-restore-versus-variable
|
||||
var alpha = replayContext.globalAlpha;
|
||||
replayContext.globalAlpha = layerState.opacity;
|
||||
var noSkip = {};
|
||||
var focusX = focus[0];
|
||||
|
||||
replayGroup.replay(replayContext, pixelRatio, transform, rotation,
|
||||
skippedFeatureUids);
|
||||
if (vectorSource.getWrapX() && projection.canWrapX() &&
|
||||
!ol.extent.containsExtent(projectionExtent, extent)) {
|
||||
var projLeft = projectionExtent[0];
|
||||
var projRight = projectionExtent[2];
|
||||
// A feature from skippedFeatureUids will only be skipped in the world
|
||||
// that has the frameState's focus, because this is where a feature
|
||||
// overlay for highlighting or selection would render the skipped
|
||||
// feature.
|
||||
replayGroup.replay(replayContext, pixelRatio, transform, rotation,
|
||||
projLeft <= focusX && focusX <= projRight ?
|
||||
skippedFeatureUids : noSkip);
|
||||
var startX = extent[0];
|
||||
var worldWidth = ol.extent.getWidth(projectionExtent);
|
||||
var world = 0;
|
||||
@@ -132,8 +122,7 @@ ol.renderer.canvas.VectorLayer.prototype.composeFrame =
|
||||
offsetX = worldWidth * world;
|
||||
transform = this.getTransform(frameState, offsetX);
|
||||
replayGroup.replay(replayContext, pixelRatio, transform, rotation,
|
||||
projLeft + offsetX <= focusX && focusX <= projRight + offsetX ?
|
||||
skippedFeatureUids : noSkip);
|
||||
skippedFeatureUids);
|
||||
startX += worldWidth;
|
||||
}
|
||||
world = 0;
|
||||
@@ -143,13 +132,9 @@ ol.renderer.canvas.VectorLayer.prototype.composeFrame =
|
||||
offsetX = worldWidth * world;
|
||||
transform = this.getTransform(frameState, offsetX);
|
||||
replayGroup.replay(replayContext, pixelRatio, transform, rotation,
|
||||
projLeft + offsetX <= focusX && focusX <= projRight + offsetX ?
|
||||
skippedFeatureUids : noSkip);
|
||||
skippedFeatureUids);
|
||||
startX -= worldWidth;
|
||||
}
|
||||
} else {
|
||||
replayGroup.replay(
|
||||
replayContext, pixelRatio, transform, rotation, skippedFeatureUids);
|
||||
}
|
||||
|
||||
if (replayContext != context) {
|
||||
|
||||
Reference in New Issue
Block a user