2

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?

asked Aug 21, 2013 at 6:01
0

1 Answer 1

3

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.

answered Aug 21, 2013 at 9:04
2
  • 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. Commented 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 Commented Aug 22, 2013 at 15:06

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.