diff --git a/examples/reprojection-by-code.js b/examples/reprojection-by-code.js index 9f24efcb8d..96203a4177 100644 --- a/examples/reprojection-by-code.js +++ b/examples/reprojection-by-code.js @@ -72,7 +72,7 @@ function search(query) { if (response) { var results = response['results']; if (results && results.length > 0) { - for (var i = 0; i < results.length; i++) { + for (var i = 0, ii = results.length; i < ii; i++) { var result = results[i]; if (result) { var code = result['code'], name = result['name'], diff --git a/externs/olx.js b/externs/olx.js index e2cd7a93f5..60da9abb15 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -3644,7 +3644,8 @@ olx.source.BingMapsOptions.prototype.maxZoom; /** - * Maximum allowed reprojection error. + * Maximum allowed reprojection error (in pixels). Default is `0.5`. + * Higher values can increase reprojection performance, but decrease precision. * @type {number|undefined} * @api */ @@ -3830,7 +3831,8 @@ olx.source.TileImageOptions.prototype.projection; /** - * Maximum allowed reprojection error. + * Maximum allowed reprojection error (in pixels). Default is `0.5`. + * Higher values can increase reprojection performance, but decrease precision. * @type {number|undefined} * @api */ @@ -4111,7 +4113,8 @@ olx.source.MapQuestOptions.prototype.layer; /** - * Maximum allowed reprojection error. + * Maximum allowed reprojection error (in pixels). Default is `0.5`. + * Higher values can increase reprojection performance, but decrease precision. * @type {number|undefined} * @api */ @@ -4211,7 +4214,8 @@ olx.source.OSMOptions.prototype.maxZoom; /** - * Maximum allowed reprojection error. + * Maximum allowed reprojection error (in pixels). Default is `0.5`. + * Higher values can increase reprojection performance, but decrease precision. * @type {number|undefined} * @api */ @@ -4615,7 +4619,8 @@ olx.source.StamenOptions.prototype.opaque; /** - * Maximum allowed reprojection error. + * Maximum allowed reprojection error (in pixels). Default is `0.5`. + * Higher values can increase reprojection performance, but decrease precision. * @type {number|undefined} * @api */ @@ -4801,7 +4806,8 @@ olx.source.TileArcGISRestOptions.prototype.projection; /** - * Maximum allowed reprojection error. + * Maximum allowed reprojection error (in pixels). Default is `0.5`. + * Higher values can increase reprojection performance, but decrease precision. * @type {number|undefined} * @api */ @@ -4877,7 +4883,8 @@ olx.source.TileJSONOptions.prototype.crossOrigin; /** - * Maximum allowed reprojection error. + * Maximum allowed reprojection error (in pixels). Default is `0.5`. + * Higher values can increase reprojection performance, but decrease precision. * @type {number|undefined} * @api */ @@ -5020,7 +5027,8 @@ olx.source.TileWMSOptions.prototype.projection; /** - * Maximum allowed reprojection error. + * Maximum allowed reprojection error (in pixels). Default is `0.5`. + * Higher values can increase reprojection performance, but decrease precision. * @type {number|undefined} * @api */ @@ -5259,7 +5267,8 @@ olx.source.WMTSOptions.prototype.projection; /** - * Maximum allowed reprojection error. + * Maximum allowed reprojection error (in pixels). Default is `0.5`. + * Higher values can increase reprojection performance, but decrease precision. * @type {number|undefined} * @api */ @@ -5445,7 +5454,8 @@ olx.source.XYZOptions.prototype.projection; /** - * Maximum allowed reprojection error. + * Maximum allowed reprojection error (in pixels). Default is `0.5`. + * Higher values can increase reprojection performance, but decrease precision. * @type {number|undefined} * @api */ @@ -5580,7 +5590,8 @@ olx.source.ZoomifyOptions.prototype.logo; /** - * Maximum allowed reprojection error. + * Maximum allowed reprojection error (in pixels). Default is `0.5`. + * Higher values can increase reprojection performance, but decrease precision. * @type {number|undefined} * @api */ diff --git a/src/ol/ol.js b/src/ol/ol.js index 48d80a1416..0e441ae844 100644 --- a/src/ol/ol.js +++ b/src/ol/ol.js @@ -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`). diff --git a/src/ol/reproj/triangulation.js b/src/ol/reproj/triangulation.js index 2e0cc278b4..2edd3d455d 100644 --- a/src/ol/reproj/triangulation.js +++ b/src/ol/reproj/triangulation.js @@ -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) { diff --git a/src/ol/source/tileimagesource.js b/src/ol/source/tileimagesource.js index 14f416517c..4cf2ae41af 100644 --- a/src/ol/source/tileimagesource.js +++ b/src/ol/source/tileimagesource.js @@ -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();