Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

This bit of information caught my eye today as I was reading about Feature Services in the ArcGIS Server .NET help:

Feature services also support HTML pop-ups setup in ArcMap. HTML pop-ups are a powerful and easy way to share HTML formatted information about features. They work much like the Identify tool, except that the information display can be customized HTML.

I set up the HTML popup in ArcMap and it worked as expected, and then I published a map service. The REST endpoint of my service now shows esriServerHTMLPopupTypeAsURL as the HTML Popup Type, however, I can't seem to find a sample, etc. that shows how to display the popup in a web application.

Does anyone have a link to a sample, or some sample code, that can show me how to do this? I have looked through the JavaScript API samples/reference and didn't find what I was looking for (or what I thought I should be looking for).

Thanks, Tim

Edit: Thanks to those who supplied answers for the links. I think I need to re-phrase the question: I'm not having problems getting the popup to display - that is working fine. My HTML popup type is set as PopupTypeAsURL, so I was expecting the popup to display the contents of the URL, say http://whateversite.com. Essentially I want the popup to display a web page or web form. Is this possible?

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

FeatureServers expose an htmlPopup resource for each feature. Displaying the popup using Javascript would be very easy. Simply send a get request with a format parameter of "json." The "content" key in the returned object contains the full HTML markup for the popup window.

The see an HTML popup example, go to http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Hydrography/Watershed173811/FeatureServer/1/1/htmlPopUp

To see the JSON version of the same popup resource, go to http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Hydrography/Watershed173811/FeatureServer/1/1/htmlPopUp?f=json

You might also consider the InfoWindow dijit in the Javascript framework API. This window gives you a configurable way to display attribute information for features loaded from a FeatureService and it works with the IdentifyTask which is a plus. Be aware, however, that the IdentifyWindow does not look at the htmlPopup that you have configured for a feature class.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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