Android计算右侧bbox for WMS getFeatureInfo

时间:2015-07-02 09:49:03

标签: android wms getfeatureinfo epsg

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

Image

地图占据了所有空间。因此我用这种方式计算了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)。

我获得的结果是:

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

问题是服务器总是返回一个空响应,即使我知道那里有功能,因为我可以看到地图上的斑点。它可能是什么?

提前致谢。

1 个答案:

答案 0 :(得分:1)

只需将composer global require "laravel/installer=~1.1" (或根据您的需要的其他数字)添加到请求中。

相关问题