Proper map extent for GetFeatureInfo request
Note that with and without this change, the pixel provided to the ol.source.wms.getFeatureInfo function will be wrong if the view has non-zero rotation.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user