Improve docs, comments and code readability
This commit is contained in:
@@ -4949,7 +4949,7 @@ olx.source.VectorOptions.prototype.url;
|
||||
|
||||
/**
|
||||
* Wrap the world horizontally. Default is `true`. For vector editing across the
|
||||
* 0° and 180° meridians to work properly, this should be set to `false`. The
|
||||
* -180° and 180° meridians to work properly, this should be set to `false`. The
|
||||
* resulting geometry coordinates will then exceed the world bounds.
|
||||
* @type {boolean|undefined}
|
||||
* @api
|
||||
|
||||
@@ -135,14 +135,16 @@ ol.renderer.canvas.Map.prototype.dispatchComposeEvent_ =
|
||||
var worldWidth = ol.extent.getWidth(projectionExtent);
|
||||
var world = 0;
|
||||
while (startX < projectionExtent[0]) {
|
||||
transform = this.getTransform(frameState, worldWidth * (--world));
|
||||
--world;
|
||||
transform = this.getTransform(frameState, worldWidth * world);
|
||||
replayGroup.replay(context, pixelRatio, transform, rotation, {});
|
||||
startX += worldWidth;
|
||||
}
|
||||
world = 0;
|
||||
startX = extent[2];
|
||||
while (startX > projectionExtent[2]) {
|
||||
transform = this.getTransform(frameState, worldWidth * (++world));
|
||||
++world;
|
||||
transform = this.getTransform(frameState, worldWidth * ++world);
|
||||
replayGroup.replay(context, pixelRatio, transform, rotation, {});
|
||||
startX -= worldWidth;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,8 @@ ol.renderer.canvas.VectorLayer.prototype.composeFrame =
|
||||
var worldWidth = ol.extent.getWidth(projectionExtent);
|
||||
var world = 0;
|
||||
while (startX < projectionExtent[0]) {
|
||||
transform = this.getTransform(frameState, worldWidth * (--world));
|
||||
--world;
|
||||
transform = this.getTransform(frameState, worldWidth * world);
|
||||
replayGroup.replay(
|
||||
replayContext, pixelRatio, transform, rotation, skippedFeatureUids);
|
||||
startX += worldWidth;
|
||||
@@ -124,7 +125,8 @@ ol.renderer.canvas.VectorLayer.prototype.composeFrame =
|
||||
world = 0;
|
||||
startX = extent[2];
|
||||
while (startX > projectionExtent[2]) {
|
||||
transform = this.getTransform(frameState, worldWidth * (++world));
|
||||
++world;
|
||||
transform = this.getTransform(frameState, worldWidth * world);
|
||||
replayGroup.replay(
|
||||
replayContext, pixelRatio, transform, rotation, skippedFeatureUids);
|
||||
startX -= worldWidth;
|
||||
@@ -229,7 +231,7 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame =
|
||||
|
||||
if (vectorSource.getWrapX() && viewState.projection.isGlobal() &&
|
||||
!ol.extent.containsExtent(projectionExtent, frameState.extent)) {
|
||||
// do not clip when the view crosses the 0 or 180 meridians
|
||||
// do not clip when the view crosses the -180° or 180° meridians
|
||||
extent[0] = projectionExtent[0];
|
||||
extent[2] = projectionExtent[2];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user