From 65f891a30de19c2b1f4581857d48881268760f32 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Tue, 30 Apr 2013 21:33:36 +0200 Subject: [PATCH] Improve type checking in ol.source.BingMaps --- src/ol/source/bingmapssource.js | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/ol/source/bingmapssource.js b/src/ol/source/bingmapssource.js index c190397441..1684940a15 100644 --- a/src/ol/source/bingmapssource.js +++ b/src/ol/source/bingmapssource.js @@ -88,16 +88,22 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse = var imageUrl = resource.imageUrl .replace('{subdomain}', subdomain) .replace('{culture}', culture); - return function(tileCoord, projection) { - goog.asserts.assert(ol.projection.equivalent( - projection, this.getProjection())); - if (goog.isNull(tileCoord)) { - return undefined; - } else { - return imageUrl.replace( - '{quadkey}', tileCoord.quadKey()); - } - }; + return ( + /** + * @param {ol.TileCoord} tileCoord Tile coordinate. + * @param {ol.Projection} projection Projection. + * @return {string|undefined} Tile URL. + */ + function(tileCoord, projection) { + goog.asserts.assert(ol.projection.equivalent( + projection, this.getProjection())); + if (goog.isNull(tileCoord)) { + return undefined; + } else { + return imageUrl.replace( + '{quadkey}', tileCoord.quadKey()); + } + }); }))); var transform = ol.projection.getTransformFromProjections(