I have issue with getFeatureInfo function. I can get features of polygon only if it is clicked on line (border) of polygon. By clicking on line, i get features of few polygons, and i want to click inside of polygon and get feature info of that polygon, nothing else. I'm using Openlayers 2.13 and GeoServer. Where can i fix this?
Perhaps you are running GeoServer 2.5 and you have faced a bug that happened if there was no fill defined for polygons. Bug was resolved in GeoServer 2.5.2. Read more details from http://osgeo-org.1560.x6.nabble.com/WMS-GetFeatureInfo-with-Polygon-td5163455.html.
First aid would be to add fill to the polygon style. Updating GeoServer should be a definitive fix but if you already run GeoServer 2.6 or 2.7 then it could mean that the bug has popped up again.