Improve type checking in ol.source.BingMaps

This commit is contained in:
Tom Payne
2013-04-30 21:33:36 +02:00
parent fe9fee1609
commit 65f891a30d

View File

@@ -88,16 +88,22 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse =
var imageUrl = resource.imageUrl var imageUrl = resource.imageUrl
.replace('{subdomain}', subdomain) .replace('{subdomain}', subdomain)
.replace('{culture}', culture); .replace('{culture}', culture);
return function(tileCoord, projection) { return (
goog.asserts.assert(ol.projection.equivalent( /**
projection, this.getProjection())); * @param {ol.TileCoord} tileCoord Tile coordinate.
if (goog.isNull(tileCoord)) { * @param {ol.Projection} projection Projection.
return undefined; * @return {string|undefined} Tile URL.
} else { */
return imageUrl.replace( function(tileCoord, projection) {
'{quadkey}', tileCoord.quadKey()); 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( var transform = ol.projection.getTransformFromProjections(