MapInfo MapXtreme 2005 WebGIS 简单鹰眼设计(转)

form

东人EP的内陆空间!


original link:
http://www.cnitblog.com/eastperson/archive/2006/10/17/18055.aspx

origin full text:
我在2005上研究了好长时间, 才弄出来个简单的鹰眼,与大家分享,我的设计思路是将后台设置两个map ,map1和map2,map1为主地图,map2为鹰眼地图,但是map2没有MapControl,定义一个实现类继承于MapBaseCommand,将map1.Bounds的矩形在map2上转换为System.Drawing.Rectangle,之后将这个Rectangle的左上坐标和width,height传到客户端,应用JS进行客户端绘图,在客户端加入一个Div,Div里放置一个IMG,如下为部分代码:
自定义类:

 1None.gifusing System;
  2None.gifusing System.Collections;
  3None.gifusing System.Drawing;
  4None.gifusing System.IO;
  5None.gifusing System.Web;
  6None.gifusing System.Web.UI.WebControls;
  7None.gifusing System.Web.UI;
  8None.gifusing MapInfo.Mapping;
  9None.gifusing MapInfo.Data;
 10None.gifusing MapInfo.WebControls;
 11None.gif
 12None.gif
 13None.gifnamespace CustomWebTools
 14ExpandedBlockStart.gifContractedBlock.gifdot.gif{
 15ExpandedSubBlockStart.gifContractedSubBlock.gif    /**//// <summary>
 16InBlock.gif    /// Info command for InfoWebTool.
 17ExpandedSubBlockEnd.gif    /// </summary>

 18InBlock.gif    [Serializable]
 19InBlock.gif    public class Info : MapInfo.WebControls.MapBaseCommand
 20ExpandedSubBlockStart.gifContractedSubBlock.gif    dot.gif{        
 21ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
 22InBlock.gif        /// Key to be used to get the pixel tolerance parameter value from the URL.
 23ExpandedSubBlockEnd.gif        /// </summary>

 24InBlock.gif        protected const string PixelToleranceKey = "PixelTolerance";
 25InBlock.gif        protected const string InfoCommand = "Info";
 26InBlock.gif        
 27InBlock.gif
 28ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
 29InBlock.gif        /// Constructor for Info class
 30ExpandedSubBlockEnd.gif        /// </summary>

 31InBlock.gif        public Info()
 32ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
 33InBlock.gif            Name = InfoCommand;
 34ExpandedSubBlockEnd.gif        }

 35InBlock.gif
 36ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
 37InBlock.gif        /// Override the Execute method in MapBasicCommand class to not save state, because
 38InBlock.gif        /// for info tool, which does not change map state, so there is no need to save map state.
 39ExpandedSubBlockEnd.gif        /// </summary>

 40InBlock.gif        public override void Execute()
 41ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
 42InBlock.gif            
 43InBlock.gif            StateManager sm = StateManager.GetStateManagerFromSession();
 44InBlock.gif            if (sm == null
 45ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
 46InBlock.gif                if(StateManager.IsManualState())
 47ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif{
 48InBlock.gif                    throw new NullReferenceException("Cannot find instance of StateManager in the ASP.NET session.");
 49ExpandedSubBlockEnd.gif                }

 50ExpandedSubBlockEnd.gif            }
 
 51InBlock.gif            ParseContext();
 52InBlock.gif            if(sm != null)
 53ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
 54InBlock.gif                PrepareStateManagerParamsDictionary(sm);
 55InBlock.gif                sm.RestoreState();
 56ExpandedSubBlockEnd.gif            }

 57InBlock.gif
 58InBlock.gif            Process();
 59ExpandedSubBlockEnd.gif        }

 60InBlock.gif
 61ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
 62InBlock.gif        /// method to do the real server side process for info tool.
 63ExpandedSubBlockEnd.gif        /// </summary>

 64InBlock.gif        public override void Process()
 65ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
 66InBlock.gif            //get pixel tolerance from url of client side.
 67InBlock.gif            int pixelTolerance = System.Convert.ToInt32(HttpContext.Current.Request[PixelToleranceKey]);
 68InBlock.gif            
 69InBlock.gif            MapControlModel model = MapControlModel.GetModelFromSession();
 70InBlock.gif            model.SetMapSize(MapAlias, MapWidth, MapHeight);
 71InBlock.gif            
 72InBlock.gif            //extract points from url of client side.
 73InBlock.gif            System.Drawing.Point[]  points = ExtractPoints(DataString);
 74InBlock.gif            
 75InBlock.gif            //do searching and get results back
 76InBlock.gif            MultiResultSetFeatureCollection mrfc = RetrieveInfo(points, pixelTolerance);
 77InBlock.gif                        
 78InBlock.gif            IEnumerator resultEnum = mrfc.GetEnumerator();
 79InBlock.gif            
 80InBlock.gif            //retrieve the selected feature from collection
 81InBlock.gif            while(resultEnum.MoveNext())
 82ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
 83InBlock.gif                IResultSetFeatureCollection irfc = (IResultSetFeatureCollection)resultEnum.Current;
 84InBlock.gif                IFeatureEnumerator ftrEnum = irfc.GetFeatureEnumerator();
 85InBlock.gif                
 86InBlock.gif                while(ftrEnum.MoveNext())
 87ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif{
 88InBlock.gif                    Feature ftr = (Feature)ftrEnum.Current;
 89InBlock.gif                    //create a html table to display feature info and stream back to client side.
 90InBlock.gif                    CreateInfoTable(ftr);        
 91InBlock.gif                    irfc.Close();
 92InBlock.gif                    mrfc.Clear();
 93InBlock.gif                    break;
 94ExpandedSubBlockEnd.gif                }
    
 95InBlock.gif                break;
 96ExpandedSubBlockEnd.gif            }
    
 97ExpandedSubBlockEnd.gif        }

 98InBlock.gif
 99ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
100InBlock.gif        /// Creates html table to hold passed in feature info, and stream back to client.
101InBlock.gif        /// </summary>
102ExpandedSubBlockEnd.gif        /// <param name="ftr">feature object</param>

103InBlock.gif        private void CreateInfoTable(Feature ftr)
104ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
105InBlock.gif            //create a table control and populat it with the column name/value(s) from the feature returned and
106InBlock.gif            // and the name of the layer where the feature belong
107InBlock.gif            System.Web.UI.WebControls.Table infoTable = new System.Web.UI.WebControls.Table();
108InBlock.gif            //set table attribute/styles
109InBlock.gif            infoTable.CellPadding = 4;            
110InBlock.gif            infoTable.Font.Name = "Arial";
111InBlock.gif            infoTable.Font.Size = new FontUnit(8);
112InBlock.gif            infoTable.BorderWidth = 1;
113InBlock.gif            //infoTable.BorderStyle = BorderStyle.Outset; 
114InBlock.gif            
115InBlock.gif            System.Drawing.Color backColor = Color.Bisque;
116InBlock.gif
117InBlock.gif            //add the first row, the layer name/value where the selected feature belongs 
118InBlock.gif            TableRow r = new TableRow();
119InBlock.gif            r.BackColor = backColor;
120InBlock.gif
121InBlock.gif            TableCell c = new TableCell();
122InBlock.gif            c.Font.Bold = true;            
123InBlock.gif            c.ForeColor = Color.Indigo;
124InBlock.gif
125InBlock.gif            c.Text = "Layer Name";            
126InBlock.gif            r.Cells.Add(c);
127InBlock.gif
128InBlock.gif            c = new TableCell();
129InBlock.gif
130InBlock.gif            //the feature returned is from a resultset table whose name is got from appending _2
131InBlock.gif            //to the real table name, so below is to get the real table name.
132InBlock.gif            string alias = ftr.Table.Alias;
133InBlock.gif            c.Text = alias.Substring(0, alias.Length-2);
134InBlock.gif            c.Font.Bold = true;
135InBlock.gif            r.Cells.Add(c);
136InBlock.gif            
137InBlock.gif            infoTable.Rows.Add(r);
138InBlock.gif
139InBlock.gif            foreach(Column col in ftr.Columns)
140ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
141InBlock.gif                String upAlias = col.Alias.ToUpper();
142InBlock.gif                //don't display obj, MI_Key or MI_Style columns
143InBlock.gif                if(upAlias != "OBJ" && upAlias != "MI_STYLE" && upAlias != "MI_KEY")
144ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif{
145InBlock.gif                    r = new TableRow();
146InBlock.gif                    r.BackColor = backColor;
147InBlock.gif
148InBlock.gif                    r.Cells.Clear();
149InBlock.gif                    c = new TableCell();
150InBlock.gif                    c.Text = col.Alias;
151InBlock.gif                    c.Font.Bold = true;
152InBlock.gif                    c.ForeColor = Color.RoyalBlue;
153InBlock.gif
154InBlock.gif                    r.Cells.Add(c);
155InBlock.gif                    c = new TableCell();
156InBlock.gif                    c.Text = ftr[col.Alias].ToString();
157InBlock.gif                    r.Cells.Add(c);
158InBlock.gif                    infoTable.Rows.Add(r);
159ExpandedSubBlockEnd.gif                }

160ExpandedSubBlockEnd.gif            }

161InBlock.gif
162InBlock.gif            //stream the html table back to client
163InBlock.gif            StringWriter sw = new StringWriter();
164InBlock.gif            HtmlTextWriter hw = new HtmlTextWriter(sw);
165InBlock.gif            infoTable.RenderControl(hw);
166InBlock.gif            String strHTML = sw.ToString();
167InBlock.gif            HttpContext.Current.Response.Output.Write(strHTML);
168ExpandedSubBlockEnd.gif        }

169InBlock.gif
170ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
171InBlock.gif        /// Get a MultiFeatureCollection containing features in all layers falling into the tolerance of the point.
172InBlock.gif        /// </summary>
173InBlock.gif        /// <param name="points">points array</param>
174InBlock.gif        /// <param name="pixelTolerance">pixel tolerance used when searching</param>
175ExpandedSubBlockEnd.gif        /// <returns>Returns a MultiResultSetFeatureCollection object</returns>

176InBlock.gif        protected MultiResultSetFeatureCollection RetrieveInfo(Point[] points, int pixelTolerance) 
177ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
178InBlock.gif            if(points.Length != 1)
179InBlock.gif                return null;
180InBlock.gif
181InBlock.gif            MapControlModel model = MapControlModel.GetModelFromSession();
182InBlock.gif            //get map object from map model
183InBlock.gif            MapInfo.Mapping.Map map = model.GetMapObj(MapAlias);
184InBlock.gif
185InBlock.gif            if(map == nullreturn null;
186InBlock.gif
187InBlock.gif            //creat a layer filter to include normal visible layers for searching
188InBlock.gif            IMapLayerFilter layerFilter = MapLayerFilterFactory.FilterForTools(
189InBlock.gif                map, MapLayerFilterFactory.FilterByLayerType(LayerType.Normal), MapLayerFilterFactory.FilterVisibleLayers(true), 
190InBlock.gif                "MapInfo.Tools.MapToolsDefault.SelectLayers"null);
191InBlock.gif
192InBlock.gif            ITableEnumerator tableEnum = map.Layers.GetTableEnumerator(layerFilter);
193InBlock.gif            
194InBlock.gif            //return if there is no valid layer to search
195InBlock.gif            if(tableEnum == nullreturn null;
196InBlock.gif
197InBlock.gif            System.Drawing.Point center = points[0];
198InBlock.gif            
199InBlock.gif            //create a SearchInfo with a point and tolerance
200InBlock.gif            SearchInfo si = MapInfo.Mapping.SearchInfoFactory.SearchNearest(map, center, pixelTolerance);
201InBlock.gif            (si.SearchResultProcessor as ClosestSearchResultProcessor).Options = ClosestSearchOptions.StopAtFirstMatch;
202InBlock.gif            //retrieve all columns
203InBlock.gif            si.QueryDefinition.Columns = null;
204InBlock.gif            
205InBlock.gif            MapInfo.Geometry.Distance d = MapInfo.Mapping.SearchInfoFactory.ScreenToMapDistance(map, pixelTolerance);
206InBlock.gif            (si.SearchResultProcessor as ClosestSearchResultProcessor).DistanceUnit=d.Unit;
207InBlock.gif            (si.SearchResultProcessor as ClosestSearchResultProcessor).MaxDistance = d.Value;
208InBlock.gif
209InBlock.gif            
210InBlock.gif            //do search
211InBlock.gif            MultiResultSetFeatureCollection mrfc = MapInfo.Engine.Session.Current.Catalog.Search(tableEnum, si);
212InBlock.gif            return mrfc;
213InBlock.gif
214ExpandedSubBlockEnd.gif        }

215ExpandedSubBlockEnd.gif    }

216InBlock.gif
217ExpandedSubBlockStart.gifContractedSubBlock.gif    /**//// <summary>
218InBlock.gif    /// ZoomValue command to write current zoom value to client for display.
219ExpandedSubBlockEnd.gif    /// </summary>

220InBlock.gif    [Serializable]
221InBlock.gif    public class ZoomValue : MapInfo.WebControls.MapBaseCommand
222ExpandedSubBlockStart.gifContractedSubBlock.gif    dot.gif{
223ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
224InBlock.gif        /// Constructor for ZoomValue class
225ExpandedSubBlockEnd.gif        /// </summary>

226InBlock.gif        public ZoomValue()
227ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
228InBlock.gif            Name = "ZoomValue";
229ExpandedSubBlockEnd.gif        }

230InBlock.gif
231ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
232InBlock.gif        /// Override the Execute method in MapBasicCommand class to NOT save state, because
233InBlock.gif        /// for this command, which does not change map state, so there is no need to save map state.
234ExpandedSubBlockEnd.gif        /// </summary>

235InBlock.gif        public override void Execute()
236ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
237InBlock.gif            
238InBlock.gif            StateManager sm = StateManager.GetStateManagerFromSession();
239InBlock.gif            if (sm == null
240ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
241InBlock.gif                if(StateManager.IsManualState())
242ExpandedSubBlockStart.gifContractedSubBlock.gif                dot.gif{
243InBlock.gif                    throw new NullReferenceException("Cannot find instance of StateManager in the ASP.NET session.");
244ExpandedSubBlockEnd.gif                }

245ExpandedSubBlockEnd.gif            }
 
246InBlock.gif            ParseContext();
247InBlock.gif            if(sm != null)
248ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
249InBlock.gif                PrepareStateManagerParamsDictionary(sm);
250InBlock.gif                sm.RestoreState();
251ExpandedSubBlockEnd.gif            }

252InBlock.gif
253InBlock.gif            Process();
254ExpandedSubBlockEnd.gif        }

255InBlock.gif
256InBlock.gif        public override void Process()
257ExpandedSubBlockStart.gifContractedSubBlock.gif        dot.gif{
258InBlock.gif            MapControlModel model = MapControlModel.GetModelFromSession();
259InBlock.gif            //get map object from map model
260InBlock.gif            MapInfo.Mapping.Map map = model.GetMapObj(MapAlias);
261InBlock.gif            MapInfo.Mapping.Map map2 = model.GetMapObj("Map2");
262InBlock.gif            System.Drawing.Rectangle rect;
263InBlock.gif            map2.DisplayTransform.ToDisplay(map.Bounds, out rect);
264InBlock.gif            
265InBlock.gif            HttpContext.Current.Response.Output.Write(rect.X);
266InBlock.gif            HttpContext.Current.Response.Output.Write(',');
267InBlock.gif            HttpContext.Current.Response.Output.Write(rect.Y);
268InBlock.gif            HttpContext.Current.Response.Output.Write(',');
269InBlock.gif            HttpContext.Current.Response.Output.Write(rect.Width);
270InBlock.gif            HttpContext.Current.Response.Output.Write(',');
271InBlock.gif            HttpContext.Current.Response.Output.Write(rect.Height);
289ExpandedSubBlockEnd.gif        }

290ExpandedSubBlockEnd.gif    }

291ExpandedBlockEnd.gif}

292None.gif
客户端JS代码:

 1 None.gif // client info command to control client behavior for info tool.
 2 None.gif function  InfoCommand(name, interaction)
 3 ExpandedBlockStart.gifContractedBlock.gif dot.gif {
 4ExpandedSubBlockStart.gifContractedSubBlock.gif    if (arguments.length > 0dot.gif{
 5InBlock.gif        this.Init(name, interaction);
 6ExpandedSubBlockEnd.gif    }

 7ExpandedBlockEnd.gif}

 8 None.gifInfoCommand.prototype  =   new  MapCommand();
 9 None.gifInfoCommand.prototype.constructor  =  InfoCommand;
10 None.gifInfoCommand.superclass  =  MapCommand.prototype;
11 None.gifInfoCommand.prototype.Execute  =   function ()
12 ExpandedBlockStart.gifContractedBlock.gif dot.gif {
13InBlock.gif    this.CreateUrl();
14InBlock.gif    this.AddParamToUrl("PixelTolerance"this.pixelTolerance);
15InBlock.gif    //create an XMLHttp obj to send request to server
16InBlock.gif    var xmlHttp = CreateXMLHttp();
17InBlock.gif    xmlHttp.open("GET"this.url, false);
18InBlock.gif    xmlHttp.send(null);
19InBlock.gif    //get response back
20InBlock.gif    this.result = xmlHttp.responseText;
21InBlock.gif    
22InBlock.gif    var div = FindElement("Info");
23InBlock.gif    if(div.style.visibility != "visible")
24InBlock.gif        div.style.visibility = "visible";        
25InBlock.gif    //display the response at client html
26InBlock.gif    div.innerHTML = "<font size=2 face=Arial><b>Selected Feature Info:</b></font><p>" + this.result;
27InBlock.gif
28ExpandedBlockEnd.gif}
;
29 None.gif // function to update zoom label
30 None.gif function  getZoomValue()
31 ExpandedBlockStart.gifContractedBlock.gif dot.gif {
32InBlock.gif    //create url to send to server, server command name is "ZoomValue"
33InBlock.gif    var url = "MapController.ashx?Command=ZoomValue&Ran=" + Math.random();
34InBlock.gif    var mapImage = document.getElementById("MapControl1_Image");                        
35InBlock.gif    if (mapImage.mapAlias) 
36InBlock.gif        url +=  "&MapAlias=" + mapImage.mapAlias;
37InBlock.gif    var xmlHttp = CreateXMLHttp();
38InBlock.gif    xmlHttp.open("GET", url, false);
39InBlock.gif    xmlHttp.send(null);
40InBlock.gif    var result = xmlHttp.responseText;        
41InBlock.gif    var div = FindElement("ZoomValue");
42InBlock.gif    div.innerHTML = "<font size=2 face=Arial><b>Zoom: <font color=Indigo>" + result + "</font></b></font>";
43InBlock.gif    
44InBlock.gif    var arr = new Array();
45InBlock.gif    arr = result.split(',');
46InBlock.gif    var left = 1*arr[0];
47InBlock.gif    var top = 1*arr[1];
48InBlock.gif    var width = 1*arr[2];
49InBlock.gif    var height = 1*arr[3];
50InBlock.gif    if (left < 0) left = 0;
51InBlock.gif    if (top < 0) top = 0;
52InBlock.gif    if (width > 232) width = 232;
53InBlock.gif    if (height > 210) height = 210;
54InBlock.gif    //alert(left+","+top+","+width+","+height);
55InBlock.gif    myDrawFunction(left, top, width, height);
56ExpandedBlockEnd.gif}
;    
57 None.gif
58 None.gif

后台HTML文件代码:

 1 ExpandedBlockStart.gif ContractedBlock.gif <% dot.gif @ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="InfoToolWeb.WebForm1_temp"  %>
 2 ExpandedBlockStart.gifContractedBlock.gif <% dot.gif @ Register TagPrefix="mapinfowebuiwebcontrols" Namespace="MapInfo.WebControls" Assembly="MapInfo.WebControls, Version=4.0.0.362, Culture=neutral, PublicKeyToken=0a9556cc66c0af57"  %>
 3 None.gif <! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"  >
 4 None.gif < HTML  xmlns:v ="urn:schemas-microsoft-com:vml" >
 5 None.gif     < HEAD >
 6 None.gif         < title > WebForm1 </ title >
 7 None.gif         < meta  content ="Microsoft Visual Studio 7.0"  name ="GENERATOR" >
 8 None.gif         < meta  content ="C#"  name ="CODE_LANGUAGE" >
 9 None.gif         < meta  content ="JavaScript"  name ="vs_defaultClientScript" >
10 None.gif         < meta  content ="http://schemas.microsoft.com/intellisense/ie5"  name ="vs_targetSchema" >
11 ExpandedBlockStart.gifContractedBlock.gif         < style > dot.gif v\:* {dot.gif}{ BEHAVIOR: url(#default#VML) }
12ExpandedBlockEnd.gif        
</ style >
13 None.gif         < script  src ="wz_jsgraphics.js"  type ="text/javascript" ></ script >
14 None.gif     </ HEAD >
15 None.gif     < body  bgColor ="#ffefd5"  MS_POSITIONING ="GridLayout" >
16 None.gif         < form  id ="Form1"  method ="post"  runat ="server" >
17 None.gif             <!--  inlcude javascript for info tool here  -->
18 None.gif             < script  language ="javascript"  src ="CustomCommand.js"  type ="text/javascript" ></ script >
19 None.gif             <!--  zoom label used to display current zoom value ->
20 None.gif            <DIV id="ZoomValue" style="DISPLAY: inline; Z-INDEX: 124; LEFT: 120px; WIDTH: 872px; POSITION: absolute; TOP: 88px; HEIGHT: 19px"
21 None.gif                ms_positioning="FlowLayout"><STRONG><FONT face="Arial" size="2">Zoom:</FONT></STRONG></DIV>
22 None.gif            <mapinfowebuiwebcontrols:mapcontrol id="MapControl1" style="Z-INDEX: 101; LEFT: 88px; POSITION: absolute; TOP: 128px"
23 None.gif                runat="server" MapAlias="Map1" Height="600px" Width="600px"></mapinfowebuiwebcontrols:mapcontrol><mapinfowebuiwebcontrols:southnavigationtool id="SouthNavigationTool2" style="Z-INDEX: 102; LEFT: 640px; POSITION: absolute; TOP: 944px"
24 None.gif                runat="server" MapControlID="MapControl1"></mapinfowebuiwebcontrols:southnavigationtool><mapinfowebuiwebcontrols:northnavigationtool id="NorthNavigationTool2" style="Z-INDEX: 104; LEFT: 224px; POSITION: absolute; TOP: 112px"
25 None.gif                runat="server" MapControlID="MapControl1"></mapinfowebuiwebcontrols:northnavigationtool><mapinfowebuiwebcontrols:eastnavigationtool id="EastNavigationTool2" style="Z-INDEX: 105; LEFT: 912px; POSITION: absolute; TOP: 552px"
26 None.gif                runat="server" MapControlID="MapControl1"></mapinfowebuiwebcontrols:eastnavigationtool><mapinfowebuiwebcontrols:westnavigationtool id="WestNavigationTool2" style="Z-INDEX: 106; LEFT: 72px; POSITION: absolute; TOP: 280px"
27 None.gif                runat="server" MapControlID="MapControl1"></mapinfowebuiwebcontrols:westnavigationtool><mapinfowebuiwebcontrols:northeastnavigationtool id="NorthEastNavigationTool1" style="Z-INDEX: 108; LEFT: 840px; POSITION: absolute; TOP: 112px"
28 None.gif                runat="server" MapControlID="MapControl1"></mapinfowebuiwebcontrols:northeastnavigationtool><mapinfowebuiwebcontrols:southwestnavigationtool id="SouthWestNavigationTool1" style="Z-INDEX: 109; LEFT: 64px; POSITION: absolute; TOP: 616px"
29 None.gif                runat="server" MapControlID="MapControl1"></mapinfowebuiwebcontrols:southwestnavigationtool><mapinfowebuiwebcontrols:southeastnavigationtool id="SouthEastNavigationTool1" style="Z-INDEX: 110; LEFT: 952px; POSITION: absolute; TOP: 848px"
30 None.gif                runat="server" MapControlID="MapControl1"></mapinfowebuiwebcontrols:southeastnavigationtool><mapinfowebuiwebcontrols:northwestnavigationtool id="NorthWestNavigationTool1" style="Z-INDEX: 111; LEFT: 72px; POSITION: absolute; TOP: 112px"
31 None.gif                runat="server" MapControlID="MapControl1"></mapinfowebuiwebcontrols:northwestnavigationtool><mapinfowebuiwebcontrols:zoombartool id="ZoomBarTool1" style="Z-INDEX: 112; LEFT: 24px; POSITION: absolute; TOP: 216px"
32 None.gif                runat="server" Height="8px" MapControlID="MapControl1" ZoomLevel="12500"></mapinfowebuiwebcontrols:zoombartool><mapinfowebuiwebcontrols:zoombartool id="ZoomBarTool2" style="Z-INDEX: 113; LEFT: 24px; POSITION: absolute; TOP: 240px"
33 None.gif                runat="server" Height="8px" MapControlID="MapControl1" ZoomLevel="6500"></mapinfowebuiwebcontrols:zoombartool><mapinfowebuiwebcontrols:zoombartool id="ZoomBarTool3" style="Z-INDEX: 114; LEFT: 24px; POSITION: absolute; TOP: 264px"
34 None.gif                runat="server" Height="8px" MapControlID="MapControl1" ZoomLevel="3550"></mapinfowebuiwebcontrols:zoombartool><mapinfowebuiwebcontrols:zoombartool id="ZoomBarTool4" style="Z-INDEX: 115; LEFT: 24px; POSITION: absolute; TOP: 288px"
35 None.gif                runat="server" MapControlID="MapControl1" ZoomLevel="1500"></mapinfowebuiwebcontrols:zoombartool><mapinfowebuiwebcontrols:zoombartool id="ZoomBarTool5" style="Z-INDEX: 116; LEFT: 24px; POSITION: absolute; TOP: 312px"
36 None.gif                runat="server" MapControlID="MapControl1" ZoomLevel="500"></mapinfowebuiwebcontrols:zoombartool><asp:image id="Image1" style="Z-INDEX: 117; LEFT: 32px; POSITION: absolute; TOP: 336px" runat="server"
37 None.gif                ImageUrl="/MapXTremeWebResources 6_5/ZoomInToolControlActive.gif"></asp:image><asp:image id="Image2" style="Z-INDEX: 118; LEFT: 32px; POSITION: absolute; TOP: 192px" runat="server"
38 None.gif                ImageUrl="/MapXTremeWebResources 6_5/ZoomOutToolControlActive.gif"></asp:image>
39 None.gif            <div id="Info" style="Z-INDEX: 119; LEFT: 712px; VISIBILITY: hidden; POSITION: absolute; TOP: 16px">Div&nbsp;element 
40 None.gif                to display selected feature information in html table.</div>
41 None.gif            <mapinfowebuiwebcontrols:pantool id="PanTool1" style="Z-INDEX: 120; LEFT: 984px; POSITION: absolute; TOP: 464px"
42 None.gif                runat="server" MapControlID="MapControl1" ClientCommand="MapCommand"></mapinfowebuiwebcontrols:pantool><mapinfowebuiwebcontrols:zoomintool id="ZoomInTool1" style="Z-INDEX: 121; LEFT: 904px; POSITION: absolute; TOP: 464px"
43 None.gif                runat="server" MapControlID="MapControl1"></mapinfowebuiwebcontrols:zoomintool><mapinfowebuiwebcontrols:zoomouttool id="ZoomOutTool1" style="Z-INDEX: 122; LEFT: 944px; POSITION: absolute; TOP: 464px"
44 None.gif                runat="server" MapControlID="MapControl1"></mapinfowebuiwebcontrols:zoomouttool><mapinfowebuiwebcontrols:centertool id="CenterTool1" style="Z-INDEX: 123; LEFT: 1024px; POSITION: absolute; TOP: 464px"
45 None.gif                runat="server" MapControlID="MapControl1"></mapinfowebuiwebcontrols:centertool><mapinfowebuiwebcontrols:pointselectiontool id="InfoWebTool1" style="Z-INDEX: 125; LEFT: 1072px; POSITION: absolute; TOP: 464px"
46 None.gif                runat="server" MapControlID="MapControl1" ClientInteraction="ClickInteraction" ActiveImageUrl="/MapXtremeWebResources 6_5/InfoToolControlActive.gif" InactiveImageUrl="/MapXtremeWebResources 6_5/InfoToolControlInActive.gif"
47 None.gif                CursorImageUrl="/MapXtremeWebResources 6_5/MapInfoWebInfo.cur" Command="Info" ClientCommand="InfoCommand"></mapinfowebuiwebcontrols:pointselectiontool><asp:label id="Label1" style="Z-INDEX: 107; LEFT: 72px; POSITION: absolute; TOP: 16px" runat="server"
48 None.gif                Height="48px" Width="712px" Font-Size="X-Large" ForeColor="Navy" BorderColor="MediumTurquoise">InfoTool Web Sample </asp:label><asp:textbox id="TextBox1" style="Z-INDEX: 103; LEFT: 64px; POSITION: absolute; TOP: 64px" runat="server"
49 None.gif                Height="8px" Width="806px" BackColor="DarkBlue"></asp:textbox><mapinfowebuiwebcontrols:rectangleselectiontool id="RectangleSelectionTool1" style="Z-INDEX: 126; LEFT: 1104px; POSITION: absolute; TOP: 464px"
50 None.gif                runat="server" MapControlID="MapControl1" Command="RectangleSelection" ClientCommand="MapCommand" Active="True"></mapinfowebuiwebcontrols:rectangleselectiontool>
51 None.gif            <div id="myCanvas" style="LEFT:896px;WIDTH:230px;POSITION:absolute;TOP:120px;HEIGHT:230px"><IMG src="file:///C:\Program Files\MapInfo\MapXtreme\6.5\Samples\Web\Features\InfoToolWeb\cs\eyemap.GIF"
52 None.gif                    height="230" width="230"></div>
53 None.gif            <script src="drawfunction.js" type="text/javascript"></script>
54 None.gif            <INPUT style="Z-INDEX: 128; LEFT: 896px; POSITION: absolute; TOP: 416px" type="button"
55 None.gif                value="Button" οnclick="myDrawFunction()">
56 None.gif            <script language="javascript" type="text/javascript">
57 None.gif                    //first time when page loads, at this point, maybe the image is already loaded, so
58 None.gif                    //alway call getZoomValue when the page loads first time.
59 None.gif                    getZoomValue();
60 None.gif                    
61 None.gif                    //hook up map image onload event with getZoomValue method.
62 None.gif                    var mapimage = document.getElementById("MapControl1_Image");            
63 None.gif                    mapimage.onload = getZoomValue;                        
64 None.gif            </script>
65 None.gif        </form>
66 None.gif    </body>
67 None.gif</HTML>
68 None.gif

http://xiexiaokui.cnblogs.com

转载于:https://www.cnblogs.com/xiexiaokui/archive/2007/01/01/609577.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值