Improve docs, comments and code readability

This commit is contained in:
Andreas Hocevar
2015-04-19 08:49:17 +02:00
parent 6a2aa833b4
commit 8fd4e2c7c5
3 changed files with 10 additions and 6 deletions

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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];
}