我试图向我的Geoserver请求检索地图上用户点击附近的功能。

地图占据了所有的空间。因此,我以这种方式计算了BBOX:
region = mMap.getProjection().getVisibleRegion().latLngBounds;
double left = region.southwest.longitude;
double top = region.northeast.latitude;
double right = region.northeast.longitude;
double bottom = region.southwest.latitude;其宽度和高度如下:
mMapFragment.getView().getWidth();
mMapFragment.getView().getHeight();而X和Y参数的计算方式如下:
Point click = mMap.getProjection().toScreenLocation(latLng);其中latLng是来自事件onMapClick(LatLng)的点(参考这里:https://developers.google.com/android/reference/com/google/android/gms/maps/GoogleMap.OnMapClickListener)。
我获得的结果URL是:
http://localhost/geoserver/sindot/wms?service=WMS&request=GetFeatureInfo&info_format=application%2Fjson&version=1.1.1&srs=EPSG%3A3857&bbox=1222173.74033,5056403.44084,1222174.11356,5056403.7028&query_layers=sindot:verticale&layers=sindot:verticale&feature_count=3&styles=tabletb3lab&width=2048&height=1262&x=1441&y=503问题是,服务器总是返回一个空的响应,即使我知道那里有一些特性,因为我可以看到地图上的点。会是什么?
提前谢谢。
发布于 2015-07-03 10:51:11
只需在请求中添加&buffer=10 (或根据您的需要添加另一个数字)。
https://stackoverflow.com/questions/31181250
复制相似问题