Overview of the ArcGIS Mobile SDK controls

The controls are introduced here with a brief overview, but there is more detailed help and sample code to aid with your development in this system.

Map

A map is a container for all of the spatial information that you display, query and edit on your mobile device. The way that you display maps in your mobile application is to use the map control. The map control is a Microsoft Visual Studio .NET component that you can drag from the Toolbox onto a form when designing your application. The map has a number of properties, methods and events that control how you display maps on a mobile device. The Map control is designed to display geographic data from a local MapCache that obtains its data from a published mobile map service. Layer properties such as visibility, symbology and scale thresholds default to their values in the published map although some of these can be changed at runtime. To use the control, drag it on to a form within your project. A MapCache component will be created if it does not already exist. A number of other Mobile SDK controls can enhance the user experience with the map, such as the Scale Bar and GPS Display controls.

The CurrentMapAction property allows you to assign a default map action or tool to the map, such as Pan, Zoom In, Zoom Out, Selection, etc. To detach a map action from the map, set the CurrentMapAction property to null.

The map object contains several properties related to the map extent. You can get the initial extent of the map that you created and published, the full extent of the map data, the rotated extent and the extent of the current view using the GetExtent, GetFullExtent, GetRotatedExtent and GetViewExtent properties. You can use either the Invalidate method or the Refresh method to refresh the display on the map control. Refresh will redraw the current extent while Invalidate will only redraw the client area where the change has occurred.

A map contains a collection of map layers. You can use MapLayers property to receive and alter properties such as the scale, extent, visibility, transparency and labeling information for a given layer. Map layers serve the purpose of rendering the content of the layer on the map control only and do not impact the map schema, storage or cached layer representation. In addition to the map layers, you can sketch or redline graphics on top of the map using either GDI directly or by using the Display object and the MapPaintEventArgs.

The map control, in addition to its properties and methods, has a number of events you can use to perform different functions. For example, you can use the Paint event to draw graphics on top of the map or the LayersDrawingStarted and LayersDrawingCompleted events to monitor the starting and stopping of drawing on the map display.

MobileCache

A MobileCache represents the storage of the MobileService data on the device. For normal applications, a MobileCache is added when you add a new Map control to your application. The local storage of data in the MobileCache is what allows the Mobile Applications to work in a disconnected environment. It is possible to have headless applications where you have a mobile service connection but no map.

MobileServiceConnection

A MobileService connection is fundamental component in all mobile applications. It represents the data communication mechanism used to send and retrieve data from a published mobile map service to the local storage.

MapActions

Access these components through the map's context menu MapAction option. This will display the MapAction Collection Editor to add and configure MapActions such as navigation controls, selection tools and editing tools.

GPSDisplay

The GPSDisplay component displays a GPS location on a map control from coordinates obtained via a GPS Serial Port or File Connection. See also Using GPS devices for more information on this component.

GPSFile and SerialPortConnection

These components manage a connection to a serial port with a GPS device or a file containing GPS sentences. The component properties set attributes such as the COM port, baud rate for the serial connection and filename for the file connection. Once the GPS connection is opened, GPS attributes can be obtained via the GpsEventArgs class on the GpsChanged event.

ScaleBar

The ScaleBar control is designed to add a basic ScaleBar to the map display. The ScaleBar properties such as text color, units, ScaleBar position etc are set through the component properties.

Additionally, the ScaleBar can show the status of information coming from an ArcGIS Server connection. When the application is retrieving information from ArcGIS Server, an in progress bar is displayed within the ScaleBar indicating to the user that the map is still receiving information.

The ScaleBar is displayed on the map at the position determined by the DisplayPosition property. The default units are set to US Customary (miles, yards, feet and inches) but this can be changed to Metric via the UnitSystem property. The scale threshold at which the units change is fixed.

To display the in progress bar within the ScaleBar, set the MapCache property to the map cache within your application. The ShowProgress property must also be set to true.


9/20/2011