Symbolize results sample

Complexity: Beginner Data Requirement: ArcGIS Tutorial Data for Desktop

This sample demonstrates how to use ClassBreaksRenderer to symbolize the graphics with similar attribute values. It also shows how to customize the callout by modifying the Extensible Markup Language (XML) style file and implementing custom callout behavior.

Sample design

This sample creates a query task, which queries all of the counties in Kansas. The query result contains the county's name and Square Mile (SQMI) information. A ClassBreaksRenderer is created and set on the GraphicsLayer. When the query result returns, the features are placed into the graphics layer and are rendered with the previously mentioned ClassBreaksRenderer. To show a callout containing the county's SQMI information, the OnSingleTapListener interface is implemented and set on the map. When the single tap occurs, the tapped county graphic is queried through the getGraphics() method on the graphics layer. Information from the graphic's result is set as the callout's content. The callout style is customized using an XML style file, which is set on the callout object.

Using the sample

Steps:
  1. Start the sample on your device.
  2. Click the Query button and wait for the query results to return.
  3. After the query results return, tap on a county to view its SQMI information.
5/31/2012