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

@@ -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'],

View File

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

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();