Reputation: 79
Geoserver layer styling part and 'bbox' don't work at the same time.
It is exactly MaxScaleDenominator
and wms bbox
.
<sld:MaxScaleDenominator>30000.0</sld:MaxScaleDenominator>
var bboxControl = 0.1;
var bbox = (coordinate[0]-bboxControl) + ',' +
(coordinate[1]-bboxControl) + ',' +
(coordinate[0]+bboxControl) + ',' +
(coordinate[1]+bboxControl);
var projection = map.getView().getProjection().getCode();
const parameter = "?SERVICE=WMS
&VERSION=1.1.1
&REQUEST=GetFeatureInfo
&FORMAT=image/png
&TRANSPARENT=true"
+ "&QUERY_LAYERS=" + layers
+ "&LAYERS=" + layers
+ "&exceptions=application/vnd.ogc.se_inimage
&INFO_FORMAT=application/json
&FEATURE_COUNT=50
&X=50&Y=50"
+ "&SRS=" + projection
+ "&STYLE=&WIDTH=101&HEIGHT=101"
+ "&BBOX=" + bbox;
$(document).ready(function(){
$.ajax({
url: getFeatureInfoUrl + parameter,
dataType : 'json',
success: function(result){
success(result);
}
});
});
If I delete one, the other works. I don't know how the two relate to each other.
Upvotes: 0
Views: 421
Reputation: 320
If your bounding box and image size combination is such that the scale of the (GetMap) image is above 30000.0 then you won't get a GetFeatureInfo response, because there is no feature to query.
You can use the actual GetFeatureInfo request to generate the associated WMS GetMap request and try it in a browser, do you get a non-blank image?
Upvotes: 2