I am using GetFeatureInfo with WMS layer to get the data behind. The request returns data only after zoom level 10 before that it returns empty features.
Does anyone having same issue?
I think it is not calculating correct X & Y until zoom level 10. If I look same on the OpenLayers demo viewer which comes with GeoServer it gives correct result.
Environment: -Leaflet 0.7.2 with GeoServer 2.5.1 serving WMS
Request sent on zoom level 9:
Request=GetFeatureInfo&EXCEPTIONS=application/vnd.ogc.se_xml&Layers=maps:dataLyr&SRS=EPSG:4326&BBOX=-163.8720703125,70.85998776061674,-159.2578125,71.67057415064292&SERVICE=WMS&width=1680&height=919&QUERY_LAYERS=maps:dataLyr&INFO_FORMAT=application/json&FEATURE_COUNT=50&&version=1.1.1&X=682&Y=388
Request sent on zoom level 10:
Request=GetFeatureInfo&EXCEPTIONS=application/vnd.ogc.se_xml&Layers=maps:dataLyr&SRS=EPSG:4326&BBOX=-162.96295166015625,71.09942906866509,-160.65582275390625,71.50400873687697&SERVICE=WMS&width=1680&height=919&QUERY_LAYERS=maps:dataLyr&INFO_FORMAT=application/json&FEATURE_COUNT=50&&version=1.1.1&X=701&Y=390
Result on zoom level 10:
Best Answer
Solved this by using calculated X & Y instead of using generated from leaflet provided function layerPointToContainerPoint
Giving Wrong X & Y
Correct X & Y from calculation