This example shows how to add selection of map features to your map. In this case, we have created a control that determines what happens when the user clicks the map. It can either do a pan-to-point based on the click, or a select-at-point.
To use the example, choose Select At Point from the Map Click Mode control below. Then click on the map. If you click a selectable feature, it will be turned the color of your selection style (usually red). If nothing is selected when you click, try zooming in to a closer scale. Not all visible features are selectable at all scales.
See the message output below the map for more information on what is happening as you interact with the map.