I'm new to WMS layers, and am looking for a way to retrieve a layer's attributes when clicking on the map, using the ArcGIS Server JS API.

The documentation is a bit sparse, but from this question it appears that I'll need to construct a query using GetFeatureInfo.

Before I re-invent the wheel, has anyone written a wrapper function or sample code which builds the appropriate query when the user clicks on the map?


1 Answer 1


The WMS GetFeatureInfo request is very similar to the GetMap request. There is an example here showing code sample for GetFeatureInfo.

Also, keep in mind, that the GetFeatureInfo is not "standardized", so depending on server vendor, the response is differently formatted. Expect to do some extra parsing/styling.

  • I ended up running a GetCapabilities, then using its values to run a GetFeatureInfo, with the height, width, extent and X/Y values calculated from the map on mouse click. Thanks for the pointer. Aug 21, 2013 at 21:34
  • I've now run into a further problem if you have a chance to look: gis.stackexchange.com/questions/69420/… - thanks Aug 22, 2013 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.