Minor code style, documentation and typo fixes

This commit is contained in:
Petr Sloup
2015-09-09 13:37:45 +02:00
parent 5388f96551
commit 94caa07168
5 changed files with 32 additions and 18 deletions

View File

@@ -174,7 +174,8 @@ ol.OVERVIEWMAP_MIN_RATIO = 0.1;
/**
* @define {number} Maximum number of source tiles for raster reprojection.
* @define {number} Maximum number of source tiles for raster reprojection of
* a single tile.
* If too many source tiles are determined to be loaded to create a single
* reprojected tile the browser can become unresponsive or even crash.
* This can happen if the developer defines projections improperly and/or
@@ -188,7 +189,7 @@ ol.RASTER_REPROJ_MAX_SOURCE_TILES = 100;
/**
* @define {number} Maximum number of subdivision steps during raster
* reprojection triangulation. Prevents high memory usage and large
* number of proj4 calls when for certain transformations and areas.
* number of proj4 calls (for certain transformations and areas).
* At most `2*(2^this)` triangles are created. Default is `10`.
*/
ol.RASTER_REPROJ_MAX_SUBDIVISION = 10;
@@ -197,7 +198,7 @@ ol.RASTER_REPROJ_MAX_SUBDIVISION = 10;
/**
* @define {number} Maximum allowed size of triangle relative to world width.
* When transforming corners of world extent between certain projections,
* The resulting triangulation seems to have zero error and no subdivision
* the resulting triangulation seems to have zero error and no subdivision
* is performed.
* If the triangle width is more than this (relative to world width; 0-1),
* subdivison is forced (respecting `ol.RASTER_REPROJ_MAX_SUBDIVISION`).

View File

@@ -83,7 +83,7 @@ ol.reproj.Triangulation = function(sourceProj, targetProj, targetExtent,
this.trianglesSourceExtent_ = null;
/**
* Indicates that source coordinates has to be shifted during reprojection.
* Indicates that source coordinates have to be shifted during reprojection.
* This is needed when the triangulation crosses
* edge of the source projection (dateline).
* @type {boolean}
@@ -286,7 +286,7 @@ ol.reproj.Triangulation.prototype.calculateSourceExtent = function() {
if (this.wrapsXInSource_) {
// although only some of the triangles are crossing the dateline,
// all coordiantes need to be "shifted" to be positive
// all coordinates need to be "shifted" to be positive
// to properly calculate the extent (and then possibly shifted back)
goog.array.forEach(this.triangles_, function(triangle, i, arr) {

View File

@@ -307,7 +307,9 @@ ol.source.TileImage.prototype.handleTileChange_ = function(event) {
* @api
*/
ol.source.TileImage.prototype.setRenderReprojectionEdges = function(render) {
if (this.renderReprojectionEdges_ == render) return;
if (this.renderReprojectionEdges_ == render) {
return;
}
this.renderReprojectionEdges_ = render;
goog.object.forEach(this.tileCacheForProjection, function(tileCache) {
tileCache.clear();