Merge pull request #1188 from tschaub/gfi-extent

Correctly generate BBOX in URL for GetFeatureInfo in ol.source.ImageWMS.
This commit is contained in:
Tim Schaub
2013-10-30 09:10:48 -07:00
2 changed files with 123 additions and 7 deletions

View File

@@ -104,13 +104,11 @@ ol.source.ImageWMS.prototype.getImage =
*/
ol.source.ImageWMS.prototype.getFeatureInfoForPixel =
function(pixel, map, success, opt_error) {
var view2D = map.getView().getView2D(),
projection = view2D.getProjection(),
size = map.getSize(),
bottomLeft = map.getCoordinateFromPixel([0, size[1]]),
topRight = map.getCoordinateFromPixel([size[0], 0]),
extent = [bottomLeft[0], topRight[0], bottomLeft[1], topRight[1]],
url = this.imageUrlFunction(extent, size, projection);
var view = map.getView().getView2D();
var size = map.getSize();
goog.asserts.assert(goog.isDefAndNotNull(size));
var extent = view.calculateExtent(size);
var url = this.imageUrlFunction(extent, size, view.getProjection());
goog.asserts.assert(goog.isDef(url),
'ol.source.ImageWMS#imageUrlFunction does not return a URL');
ol.source.wms.getFeatureInfo(url, pixel, this.getFeatureInfoOptions_, success,