I'm doing tests to query layers in Leaflet with WMS.

I'm seeing this

https://github.com/mmsmdali/ll1.0.3/blob/master/GetFeatureInfoWMS.htm and


I'm trying to take WMS data from my Geoserver and replaced the WMS URL, the name of the layer, and the name of the fields in the popup window but I have a problem: I see the layers in the map, but it does not make me select, and I do not see the fields in the popup.

Do I need to change some settings in my Geoserver?

  • Check the request sent when you click on layer using debug in Chrome, is there a request sent or no ? – Shiko Apr 20 '17 at 8:21
  • No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'localhost' is therefore not allowed access. – fedemap Apr 20 '17 at 8:25
  • Try below answer: gis.stackexchange.com/questions/210316/… – Shiko Apr 20 '17 at 8:27
  • Well, I did as you told me, but now when I select, I see the popup attributes but it does not highlight it. Why? – fedemap Apr 20 '17 at 9:20