Developing Web Applications with the Web ADF - Web controls  

Map control



The Map control is designed to display geographic data from one or more resources provided by different data source types.   The Map control must be associated with a MapResourceManager to define the resources displayed within the map.  The MapResourceManager also provides a way to set the Transparency settings for the resources, each of which is treated as a separate layer within the map.   The Map control blends the resources together and renders a single image.  Advanced map tool functionality enables continuous panning and zooming capabilities without reloading the Web page that contains the map (in other words, a full postback is not required).  In addition, game style navigation provides scroll-wheel zoom and keyboard navigation options at runtime.  A number of other Web ADF controls buddy with the map control to enhance the user experience with the map, such as the Toolbar, Navigation, MapTips, and ZoomLevel controls. 

Assembly: ESRI.ArcGIS.ADF.Web.UI.WebControls.dll
Class: ESRI.ArcGIS.ADF.Web.UI.WebControls.Map

Using the Map control
  1. Add the controls to the page

    Open or create a Web site within Visual Studio.NET.   Open a Web form in design mode, select the Toolbox, and expand the ArcGIS Web Controls tab.  Drag and drop a MapResourceManager and a Map control on the Web form.  Add one or more resources to the MapResourceManager.  See the Add Resources section in the MapResourceManager control topic for information on how to do this.  You should see the following in Visual Studio:

      
  2. Set Map properties

    Select the Map control.  In the Properties page:
    1. Set the MapResourceManager property to the name of the MapResourceManager created and configured in the previous steps. 
    2. Set the PrimaryMapResource property to a ResourceItem in the MapResourceManager.  The ResourceItem cannot be a Graphics Layer.   See the discussion on defining a Primary Map Resource for more details.  
    3. Resize the map control to an acceptable size.  Left click and hold over a handle on a side or a corner of the control and drag the control to an acceptable size.   By default, the position of controls added in Visual Studio 2005 at design time is not set.  As a result, the controls are permitted to flow from left to right within a line, and from top to bottom within the page.  See the section about control positioning in the Visual Studio Integration topic for more information.

      Additional properties can be configured to change how the map behaves at runtime.  See the Properties section below for more detailed information.
  3. Specify buddy Controls

    The map is usually the central control for any Web-based GIS application.  As a result, it is often buddied with other supplementary controls.  The Map itself does not specifically define a buddy control.  On the contrary, other controls included with the Web ADF buddy to the map.  This includes the Toc, MapTips, OverviewMap, ZoomLevel, Navigation, Toolbar, and task controls.  All are used to enhance map control interaction.     

Members

Properties

  The following table provides a list of properties and events of interest.  For complete reference information, see the Map control in the library reference section.

Property Name  Type Description
EnableContinuousCallback bool Whether images will be fetched continuously during panning of the map or only when panning is complete.
EnableTileCaching bool Whether tiles that have been retrieved during panning of the map will be cached until the scale is changed.
EnableZoomAnimation bool Whether animation will happen for fixed zoom operations.
ImageBlendingMode ImageBlendingMode Whether images will be blended on the web server or on the browser.
ImageFormat Format of output image.
InitialExtent InitialExtent The initial extent at which the Map first renders.
MapResourceManager string The ID of the MapResourceManager whose resources will be displayed on the map.
PreferredTileHeight int The preferred tile height to request if the resources are not bound to a tile caching scheme.
PreferredTileWidth int The preferred tile width to request if the resources are not bound to a tile caching scheme.
PrimaryMapResource string The primary MapResource whose properties other MapResources will adhere to for blending to take place.   This property cannot be a Graphics Layer.  If the property is empty the last resource item will be used.
Rotation double The rotation of the map in degrees. If value is a NaN, the primary map resource's rotation is used. Otherwise, the rotation is applied. 0 is a valid rotation value and can be used to change the default rotation of the primary map resource. When rotation is applied, all resources in the map should support map rotation.
ScrollWheelZoom bool Whether the map can be zoomed using the mouse scroll wheel.
ToolItems MapToolItemCollection Map Tool Item collection.
UseMimeData bool Set true to store output images in session and stream them to the client or to store them on the file system instead.
VirtualDirectory string The path to the virtual directory in which images can be written, for example, ~/output/.


Events

Event Type  Description
Circle Raised when the control processes a tool associated with the Circle Client Tool Action.
DragImage Raised when the control processes a tool associated with the DragImage Client Tool Action.
DragRectangle Raised when the control processes a tool associated with the DragRectangle Client Tool Action.
ExtentChanged Occurs when the extent of this control has changed.
Line Raised when the control processes a tool associated with the Line Client Tool Action.
MapClick Occurs when the control is clicked.
Oval Raised when the control processes a tool associated with the Oval Client Tool Action.
Point Raised when the control processes a tool associated with the Point Client Tool Action.
Polygon Raised when the control processes a tool associated with the Polygon Client Tool Action.
Polyline Raised when the control processes a tool associated with the Polyline Client Tool Action.
Refreshed Occurs when the Map is fully refreshed. Does not occur if only one resource is refreshed with browser blending.
Resized Occurs when the Map control is resized.
ResourceRefreshed Occurs when a map resource is refreshed. May be used to detect single-resource refreshing with browser blending.
RotationAngleChanged Occurs when the rotation of the map has changed.
ScaleChanged Occurs when the scale of the Map is changed.
TilingSchemeInitialized Occurs when the Map is done initializing the TilingScheme.


Discussion