Can somebody provide a good explanation/comparison between Info Window vs. Popup Window. It seems both can be used with Feature layers. What are the pros and cons of either and when is more appropriate to use one than the other?
2 Answers
Can somebody provide a good explanation/comparison between Info Window vs. Popup Window.
Info window has been with the API since the 1.x days, Popup was added at version 2.3. Up until version 3.4, info window was the default for the map. At version 3.4 and later popup is the default.
Info window is a simpler: you set a title and set content. You can get creative with this, but in general you're building strings and sending them to infoWindow.setTitle and infoWindow.setContent.
The popup can do everything an info window can do plus it has a couple of extra capabilities. You can use setFeatures to associate an array of features with the popup and you can also use popup templates which can include things like charts. The popup also includes a default feature selection symbols, which you can see when you select a feature on a site like arcgis.com. You could say the popup gives you a clearer connection to a feature or set of features on a map.
Both can be used with feature layers or even graphics layers.
Unless you really really like the visual style of the info window, I'd say always use the popup. If you want to change the appearance of the popup, check out the making your pop-up pop blog post.
Waning I work mostly in flex so this might not be appropriate for javascript.
As far as I know the popup is, or can be used as, part of the info window. In my experiance it allows more stuff to be rendered in the info window. From the documentation
The pop-up displays information within the InfoWindow and is usually set as the infoWindowRenderer on graphics, graphics layers or LayerInfoWindowRenderer (for tiled and dynamic services).
You don't have to use a popup object but if you don't you are limited, or have to work harder, to get the contents of the infowindow to display.
-
OP tagged this as a JS API question, not flex so I don't think your answer is appropriate. Commented Feb 13, 2014 at 19:34