最后效果图

foreverlove.us

开发环境:  vs 2005

arcgis envirment: arcgis .net sdk

aspx代码:

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="ESRI.ArcGIS.ADF.Web.UI.WebControls, Version=9.3.0.1770, 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>第一个地图服务</title>
<style type="text/css">
   body{
   font-size:12px;
   }
   #main{
   float:left;
   width:500px;
   }
   #right{
    border-left-width:1px;
    border-left-color:black;
     border-left-style:solid;
   float:left;
   }
</style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <div id="header"> 头部<br />
        <br />
    </div>
    <div id="container"> </div>
       <div id="main">
       <esri:Toolbar ID="Toolbar1" runat="server" BuddyControlType="Map" Group="Toolbar1_Group"
            Height="70px" ToolbarItemDefaultStyle-BackColor="White" ToolbarItemDefaultStyle-Font-Names="Arial"
            ToolbarItemDefaultStyle-Font-Size="Smaller" ToolbarItemDisabledStyle-BackColor="White"
            ToolbarItemDisabledStyle-Font-Names="Arial" ToolbarItemDisabledStyle-Font-Size="Smaller"
            ToolbarItemDisabledStyle-ForeColor="Gray" ToolbarItemHoverStyle-BackColor="White"
            ToolbarItemHoverStyle-Font-Bold="True" ToolbarItemHoverStyle-Font-Italic="True"
            ToolbarItemHoverStyle-Font-Names="Arial" ToolbarItemHoverStyle-Font-Size="Smaller"
            ToolbarItemSelectedStyle-BackColor="White" ToolbarItemSelectedStyle-Font-Bold="True"
            ToolbarItemSelectedStyle-Font-Names="Arial" ToolbarItemSelectedStyle-Font-Size="Smaller"
            WebResourceLocation="/aspnet_client/ESRI/WebADF/" Width="400px">
            <ToolbarItems>
                <esri:Tool ClientAction="DragRectangle" DefaultImage="esriZoomIn.gif" HoverImage="esriZoomInU.gif"
                    JavaScriptFile="" Name="MapZoomIn" SelectedImage="esriZoomInD.gif" ServerActionAssembly="ESRI.ArcGIS.ADF.Web.UI.WebControls"
                    ServerActionClass="ESRI.ArcGIS.ADF.Web.UI.WebControls.Tools.MapZoomIn" Text="Zoom In"
                    ToolTip="Zoom In" />
                <esri:Tool ClientAction="DragRectangle" DefaultImage="esriZoomOut.gif" HoverImage="esriZoomOutU.gif"
                    JavaScriptFile="" Name="MapZoomOut" SelectedImage="esriZoomOutD.gif" ServerActionAssembly="ESRI.ArcGIS.ADF.Web.UI.WebControls"
                    ServerActionClass="ESRI.ArcGIS.ADF.Web.UI.WebControls.Tools.MapZoomOut" Text="Zoom Out"
                    ToolTip="Zoom Out" />
                <esri:Tool ClientAction="DragImage" DefaultImage="esriPan.gif" HoverImage="esriPanU.gif"
                    JavaScriptFile="" Name="MapPan" SelectedImage="esriPanD.gif" ServerActionAssembly="ESRI.ArcGIS.ADF.Web.UI.WebControls"
                    ServerActionClass="ESRI.ArcGIS.ADF.Web.UI.WebControls.Tools.MapPan" Text="Pan"
                    ToolTip="Pan" />
                <esri:Command ClientAction="" DefaultImage="esriFullExt.gif" HoverImage="esriFullExtU.gif"
                    JavaScriptFile="" Name="MapFullExtent" SelectedImage="esriFullExtD.gif" ServerActionAssembly="ESRI.ArcGIS.ADF.Web.UI.WebControls"
                    ServerActionClass="ESRI.ArcGIS.ADF.Web.UI.WebControls.Tools.MapFullExtent" Text="Full Extent"
                    ToolTip="Full Extent" />
                <esri:Command BuddyItem="MapForward" ClientAction="ToolbarMapBack" DefaultImage="esriBack.gif"
                    Disabled="True" DisabledImage="esriBack.gif" HoverImage="esriBackU.gif" JavaScriptFile=""
                    Name="MapBack" SelectedImage="esriBackD.gif" Text="Back" ToolTip="Map Back Extent" />
                <esri:Command BuddyItem="MapBack" ClientAction="ToolbarMapForward" DefaultImage="esriForward.gif"
                    Disabled="True" DisabledImage="esriForward.gif" HoverImage="esriForwardU.gif"
                    JavaScriptFile="" Name="MapForward" SelectedImage="esriForwardD.gif" Text="Forward"
                    ToolTip="Map Forward Extent" />
            </ToolbarItems>
            <BuddyControls>
                <esri:BuddyControl Name="Map1" />
            </BuddyControls>
        </esri:Toolbar>
       <esri:Map ID="Map1" runat="server" Height="500px" Width="500px" MapResourceManager="MapResourceManager1">
        </esri:Map></div>
       <div id="right">
           图层<br />
           <esri:Toc ID="Toc1" runat="server" BuddyControl="Map1" ExpandDepth="1" Height="500px" />
           <br />
       </div>
       <div style="clear:both;"></div>
    <div id="footer"> 脚部<br />
        <esri:MapResourceManager ID="MapResourceManager1" runat="server">
            <ResourceItems>
                <esri:MapResourceItem Definition="&lt;Definition DataSourceDefinition=&quot;http://zimp001.gicp.net/ArcGIS/services/&quot; DataSourceType=&quot;ArcGIS Server Internet&quot; Identity=&quot;Txz2yC+nS1QVBMNnBbu4PIhRPo8PnEpwikdTi7dU8jVicf6N2G8Jag==&quot; ResourceDefinition=&quot;Layers@world&quot; DataSourceShared=&quot;True&quot; /&gt;"
                    DisplaySettings="visible=True:transparency=0:mime=True:imgFormat=PNG8:height=100:width=100:dpi=96:color=:transbg=False:displayInToc=True:dynamicTiling="
                    LayerDefinitions="" Name="MapResourceItem0" />
            </ResourceItems>
        </esri:MapResourceManager>
        <br />
    </div>
    </form>
</body>
</html>