Fix multiple type errors in getFeatureInfoForPixel

This commit is contained in:
Tom Payne
2013-12-13 16:42:10 +01:00
parent a93e0b85df
commit 5f0ea858ec
2 changed files with 10 additions and 6 deletions

View File

@@ -109,7 +109,9 @@ ol.source.ImageWMS.prototype.getFeatureInfoForPixel =
var size = map.getSize();
goog.asserts.assert(goog.isDefAndNotNull(size));
var extent = view.calculateExtent(size);
var url = this.imageUrlFunction(extent, size, view.getProjection());
var projection = view.getProjection();
goog.asserts.assert(goog.isDef(projection));
var url = this.imageUrlFunction(extent, size, projection);
goog.asserts.assert(goog.isDef(url),
'ol.source.ImageWMS#imageUrlFunction does not return a URL');
ol.source.wms.getFeatureInfo(url, pixel, this.getFeatureInfoOptions_, success,

View File

@@ -157,11 +157,13 @@ ol.source.TileWMS.prototype.getFeatureInfoForPixel =
function(pixel, map, success, opt_error) {
var coord = map.getCoordinateFromPixel(pixel),
view2D = map.getView().getView2D(),
projection = view2D.getProjection(),
tileGrid = goog.isNull(this.tileGrid) ?
ol.tilegrid.getForProjection(projection) : this.tileGrid,
tileCoord = tileGrid.getTileCoordForCoordAndResolution(coord,
view2D.getResolution()),
projection = view2D.getProjection();
goog.asserts.assert(goog.isDef(projection));
var tileGrid = goog.isNull(this.tileGrid) ?
ol.tilegrid.getForProjection(projection) : this.tileGrid;
var resolution = view2D.getResolution();
goog.asserts.assert(goog.isDef(resolution));
var tileCoord = tileGrid.getTileCoordForCoordAndResolution(coord, resolution),
tileExtent = tileGrid.getTileCoordExtent(tileCoord),
offset = map.getPixelFromCoordinate(ol.extent.getTopLeft(tileExtent)),
url = this.tileUrlFunction(tileCoord, projection);