Android BMS calculator for WMS getFeatureInfo

I am trying to make a request to my Geoserver to retrieve the functions next to the user's tap on the map.

Image

All space is displayed. Therefore, I calculated BBOX this way:

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; 

and width and height are taken as belows:

 mMapFragment.getView().getWidth(); mMapFragment.getView().getHeight(); 

while the parameters X and Y are calculated as follows:

 Point click = mMap.getProjection().toScreenLocation(latLng); 

where latLng is the point that appeared in the onMapClick (LatLng) event (link here: https://developers.google.com/android/reference/com/google/android/gms/maps/GoogleMap.OnMapClickListener ).

The resulting URL is:

 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 

The problem is that the server always returns an empty answer, even if I know that there are functions there, because I see spots on the map. What could it be?

Thanks in advance.

+8
android wms
source share
1 answer

He just wanted to add &buffer=10 (or another number according to your needs) to the request.

+1
source share

All Articles