Check forward/back 1 world if wrapping
This commit is contained in:
@@ -181,11 +181,11 @@ ol.renderer.canvas.VectorLayer.prototype.composeFrame = function(frameState, lay
|
|||||||
ol.render.canvas.rotateAtOffset(replayContext, -rotation,
|
ol.render.canvas.rotateAtOffset(replayContext, -rotation,
|
||||||
width / 2, height / 2);
|
width / 2, height / 2);
|
||||||
replayGroup.replay(replayContext, transform, rotation, skippedFeatureUids);
|
replayGroup.replay(replayContext, transform, rotation, skippedFeatureUids);
|
||||||
if (vectorSource.getWrapX() && projection.canWrapX() &&
|
if (vectorSource.getWrapX() && projection.canWrapX()) {
|
||||||
!ol.extent.containsExtent(projectionExtent, extent)) {
|
|
||||||
var startX = extent[0];
|
var startX = extent[0];
|
||||||
var worldWidth = ol.extent.getWidth(projectionExtent);
|
var worldWidth = ol.extent.getWidth(projectionExtent);
|
||||||
var world = 0;
|
var world = 0;
|
||||||
|
startX -= worldWidth;
|
||||||
var offsetX;
|
var offsetX;
|
||||||
while (startX < projectionExtent[0]) {
|
while (startX < projectionExtent[0]) {
|
||||||
--world;
|
--world;
|
||||||
@@ -196,6 +196,7 @@ ol.renderer.canvas.VectorLayer.prototype.composeFrame = function(frameState, lay
|
|||||||
}
|
}
|
||||||
world = 0;
|
world = 0;
|
||||||
startX = extent[2];
|
startX = extent[2];
|
||||||
|
startX += worldWidth;
|
||||||
while (startX > projectionExtent[2]) {
|
while (startX > projectionExtent[2]) {
|
||||||
++world;
|
++world;
|
||||||
offsetX = worldWidth * world;
|
offsetX = worldWidth * world;
|
||||||
@@ -325,8 +326,7 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame = function(frameState, lay
|
|||||||
vectorLayerRenderBuffer * resolution);
|
vectorLayerRenderBuffer * resolution);
|
||||||
var projectionExtent = viewState.projection.getExtent();
|
var projectionExtent = viewState.projection.getExtent();
|
||||||
|
|
||||||
if (vectorSource.getWrapX() && viewState.projection.canWrapX() &&
|
if (vectorSource.getWrapX() && viewState.projection.canWrapX()) {
|
||||||
!ol.extent.containsExtent(projectionExtent, frameState.extent)) {
|
|
||||||
// For the replay group, we need an extent that intersects the real world
|
// For the replay group, we need an extent that intersects the real world
|
||||||
// (-180° to +180°). To support geometries in a coordinate range from -540°
|
// (-180° to +180°). To support geometries in a coordinate range from -540°
|
||||||
// to +540°, we add at least 1 world width on each side of the projection
|
// to +540°, we add at least 1 world width on each side of the projection
|
||||||
|
|||||||
Reference in New Issue
Block a user