When displaying information in your web application, it is important to consider whether the data should be displayed as client-side graphics or, rather, a server-generated image result. There are many factors to consider when choosing which option works most efficiently. Below are just a couple of considerations. These are not all-inclusive but are provided as an example for some things you may want to consider when developing your ArcGIS API for Flex web application.
In other words, how much data is being transmitted over the network from the server hosting ArcGIS Server or Online and the client, e.g. the web browser displayed the web application. Generally, any data that is returned via a task, e.g. a query, would be in the form of a FeatureSet object. The FeatureSet object contains an array of graphics features. These features are Graphic objects. A graphic contains geometry, attributes, and a symbol. All of this is returned from the server in either: JSON format or AMF format.
One consideration when determining network traffic is the level of detail per feature. Returning a FeatureSet of 50 simple points, e.g. cities, will not be the same as returning a FeatureSet of 50 detailed polygons, e.g. counties with non-generalized boundaries. Ideally, you would want your information to pass from server to client or vice-versa as quickly as possible. Two common examples of information transfer can be seen in the scenarios below:
- Server to client - performing a query to return a FeatureSet of graphics to the client
- Client to server - using the Draw tool to create features client-side and subsequently sending these features to the server
When many graphics are rendered, especially those with complex geometries, client-side performance can suffer. Please see Performance considerations in the Query topic for more detailed suggestions. When specifically working with a query, a couple of suggestions to increase performance are to use generalized copies of data whenever possible or provide the maxAllowableOffset to generalize the returned geometry.
Please see the following examples for more information on how to use maxAllowableOffset:
Think about how results should be generated and how does the end user of your web application need to interact with these results. Question whether it is necessary for all of the information to be sent client-side in order to interact with the data. For example, should you mouse over a feature to see a tooltip? Or, as an alternative, could you generate the result server-side and just display the returned image? How many features are drawn at various scale levels? Use scale dependencies if appropriate. Prior to ArcGIS 10.1 and the Flex 3.x API, most web applications used client-side graphics for display scenarios. Now with 10.1 and 3.x, there are more options to render content server-side and display results on the client. More information regarding how this is accomplished can be found in the Dynamic Workflows section of the help.