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 | Fromat 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. |
| 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. |
| Keyboard\Mouse Shortcut | Map Action |
|---|---|
| SHIFT, left mouse click, hold, and drag box | ZoomIn |
| ALT, left mouse click, hold, and drag box | ZoomOut |
| Left mouse click, hold, and move (default mouse action> | Pan |
| Num Lock disabled, use keypad | Pan |
| Arrow keys, Home, End, Page Up, Page Down | Pan |
| CTRL, left mouse click | Identify in the Web Mapping Application template |
| Mouse Wheel Up | ZoomIn |
| Mouse Wheel Down | ZoomOut |
if (map.ImageBlendingMode == ImageBlendingMode.WebTier)
{ map.Refresh(); }
else if (map.ImageBlendingMode == ImageBlendingMode.Browser)
{ map.RefreshResource(MyMapResource.Name); }
If map.ImageBlendingMode = ImageBlendingMode.WebTier Then map.Refresh() ElseIf map.ImageBlendingMode = ImageBlendingMode.Browser Then map.RefreshResource(MyMapResource.Name) EndIf
<script language="javascript" type="text/javascript"> mouseWheelAwayZoomIn = false; <script>
protected void Page_PreRender(object sender, EventArgs ea){
if (!Page.IsPostBack){
ESRI.ArcGIS.ADF.Web.Geometry.Envelope initextent = new ESRI.ArcGIS.ADF.Web.Geometry.Envelope(-110, 30,-100, 40);
Map1.Extent = initextent;
}
}
Protected Sub Page_PreRender(sender As object, ea As EventArgs)
If Not Page.IsPostBack Then
Dim initextent As New ESRI.ArcGIS.ADF.Web.Geometry.Envelope(-110, 30,-100, 40)
Map1.Extent = initextent
EndIf
End Sub
ArrayList bitmaps = new ArrayList();
foreach (IMapFunctionality mf in Map1.GetFunctionalities()){
mf.DisplaySettings.ImageDescriptor.Height = imgheight;
mf.DisplaySettings.ImageDescriptor.Width = imgwidth;
mf.DisplaySettings.ImageDescriptor.TransparentBackground = true;
mf.DisplaySettings.ImageDescriptor.ImageFormat = ESRI.ArcGIS.ADF.Web.ImageFormat.PNG8;
ESRI.ArcGIS.ADF.Web.MapImage mi = mf.DrawExtent(Map1.Extent);
bitmaps.Add(mi.GetImage());
}
System.Drawing.Bitmap newimg = new System.Drawing.Bitmap(imgwidth, imgheight);
System.Drawing.Graphics imggraphics = System.Drawing.Graphics.FromImage(newimg);
imggraphics.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.LightGray), 0, 0, imgwidth, imgheight);
for (int j = bitmaps.Count-1; j >=0; j--){
System.Drawing.Bitmap bmp = (System.Drawing.Bitmap)bitmaps[j];
imggraphics.DrawImage(bmp, 0, 0, imgwidth, imgheight);
}
Map1.Reset(); Map1.Rotation = 45;Rotating an ArcGIS Server cached map service requires that dynamic map images are generated - the cached map tiles will not be used. As a result, many of the performance benefits of a cached map service are negated. Web ADF controls that work with the Map also support rotation, such as the Navigation, Magnifier, and OverviewMap controls.
| Tile retrieval: Browser blending | |
|---|---|
| JAVASCRIPT: Virtual Directory |
Browser retrieves the image directly by its URL using JavaScript. This is probably the most common scenario when defaults are used to set up the map service and web application, and no security is applied to the map service. It is also typically the fastest way to retrieve map tiles. |
| JAVASCRIPT: Tile Web Service |
Browser calls an HTTP handler on the Web service running on the ArcGIS Server machine that reads the image from disk and sends back the image as a stream of bytes. |
| TILE HANDLER: Virtual Directory |
Browser calls an HTTP handler (TileHandler.ashx) on the Web ADF server that uses credentials to access a secured virtual directory and sends back the image as a stream of bytes. |
| TILE HANDLER: Tile Web Service |
Browser calls an HTTP handler (TileHandler.ashx) on ADF server that uses credentials to access an HTTP handler on ArcGIS Server machine. The handler on The ArcGIS Server machine reads the image from disk and streams back the image as a series of bytes. |
| TILE HANDLER: GetMapTile |
Browser calls an HTTP handler (TileHandler.ashx) on ADF server that in turn calls a web service method that returns image bytes. The HTTP handler streams back the bytes of the image. In this case, the ArcGIS Server Object Manager and Server Object Container are used to retrieve the tile. |
| Tile retrieval: Web tier blending | |
|---|---|
| WEB TIER: Virtual directory |
During page life cycle, the image is read from the virtual directory and is blended to overlay with other resources (layers) in the map. The blended image is then sent to the browser. |
| WEB TIER: Tile Web service |
During page life cycle, the image is retrieved from an HTTP handler on the ArcGIS Server machine. The handler on the ArcGIS Server machine reads the image from disk and streams back the bytes. The image is blended to overlay with other resources (layers) in the map. The blended image is then sent to the browser. |
| WEB TIER: GetMapTile |
During page life cycle, the image is retrieved through a Web service method that returns image bytes. The image is blended to overlay with other resources (layers) in the map. The blended image is then sent to the browser. |
| Event | Description |
|---|---|
| add_onRequestsPending | Triggered when the number of items in the pendingTiles array changes from 0 to a higher value. |
| add_onRequestsRemove | Triggered when an item is removed from the pendingTiles array. |
| add_onRequestsCompleted | Triggered when the number of item in the pendingTiles array changes to 0. |
map.pendingTiles.add_onRequestsPending(showBusyIndicator)
function showBusyIndicator(sender) {
showLayer("BusyIndicator");
if (sender!=null) {
window.status = "Pending Tiles: " + sender.pendingTiles.length;
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="ESRI.ArcGIS.ADF.Web.UI.WebControls, Version=9.2.2.1350, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86"
Namespace="ESRI.ArcGIS.ADF.Web.UI.WebControls" TagPrefix="esri" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<esri:MapResourceManager ID="MapResourceManager1" runat="server">
<ResourceItems>
</ResourceItems>
</esri:MapResourceManager>
<esri:Map ID="Map1" runat="server" Height="453px" Width="556px" MapResourceManager="MapResourceManager1">
</esri:Map>
</div>
<div id="BusyIndicator" style="z-index: 1000; left: 25px; width: 100px; position: absolute; top: 422px;height: 100px">
<img src="images/CircleThickbox.gif" />
</div>
</form>
<script language="javascript" type="text/javascript">
function showBusyIndicator(sender) {
showLayer("BusyIndicator");
if (sender!=null) {
window.status = "Pending Tiles: " + sender.pendingTiles.length;
}
}
function showPendingTiles(sender) {
if (sender!=null) {
window.status = "Pending Tiles: " + sender.pendingTiles.length;
}
}
function hideBusyIndicator(sender) {
hideLayer("BusyIndicator");
if (sender!=null) {
window.status = "";
}
}
// add busy indicator functions to the map
map = Maps["Map1"];
map.pendingTiles.add_onRequestsPending(showBusyIndicator);
map.pendingTiles.add_onRequestsRemove(showPendingTiles);
map.pendingTiles.add_onRequestsCompleted(hideBusyIndicator);
</script>
</body>
</html>