阅读:2752回复:4
最强的C#+ MAPX资料,希望大家帮我用C#做个鹰眼
最强的C#+ MAPX资料,希望大家帮我用C#+MAPX做个鹰眼,谢谢
|
|
1楼#
发布于:2007-04-17 15:27
鹰眼图实际上是在导航图上,显示一个主窗体显示的区域!在导航图上添加一个临时层,在上面添加一个矩形的图元!
<P>private void InitEagleReigon()<BR> {<BR> MapXLib.Feature TempFea; <BR> MapXLib.StyleClass tempStyle;<BR> <BR> try<BR> {<BR> if (this.m_eagleLayer.AllFeatures.Count == 0)//判断该图元是否存在<BR> {<BR> tempStyle = new MapXLib.StyleClass();<BR> //设置矩形边框样式<BR> tempStyle.RegionPattern = MapXLib.FillPatternConstants.miPatternNoFill;<BR> tempStyle.RegionBorderColor = 255;<BR> tempStyle.RegionBorderWidth = 2;<BR> //在临时图层添加大小为mymap的边界的Rectangle对象<BR> MapXLib.Points pnts = new MapXLib.Points();<BR> pnts.AddXY(axMap_Full.CtlBounds.XMin, axMap_Full.CtlBounds.YMin, 1);<BR> pnts.AddXY(axMap_Full.CtlBounds.XMax, axMap_Full.CtlBounds.YMin, 2);<BR> pnts.AddXY(axMap_Full.CtlBounds.XMax, axMap_Full.CtlBounds.YMax, 3);<BR> pnts.AddXY(axMap_Full.CtlBounds.XMin, axMap_Full.CtlBounds.YMax, 4);<BR> TempFea = this.axMap_Eagle.FeatureFactory.CreateRegion(pnts, tempStyle);<BR> m_fea = m_eagleLayer.AddFeature(TempFea, nullObject);<BR> m_fea.Update(true, nullObject); <BR> }<BR> else<BR> {<BR> m_fea.Parts._Item(1).RemoveAll();<BR> m_fea.Parts._Item(1).AddXY(axMap_Full.CtlBounds.XMin, axMap_Full.CtlBounds.YMin, 1);<BR> m_fea.Parts._Item(1).AddXY(axMap_Full.CtlBounds.XMax, axMap_Full.CtlBounds.YMin, 2);<BR> m_fea.Parts._Item(1).AddXY(axMap_Full.CtlBounds.XMax, axMap_Full.CtlBounds.YMax, 3);<BR> m_fea.Parts._Item(1).AddXY(axMap_Full.CtlBounds.XMin, axMap_Full.CtlBounds.YMax, 4);<BR> m_fea.Update(true, nullObject); <BR> }<BR> }<BR> catch (Exception ex)<BR> {<BR> MessageBox.Show("InitEagleReigon:" + ex.Message);<BR> }<BR> }</P> <DIV> </DIV> <DIV> </DIV> <DIV>#region 鹰眼功能模块<BR> private void axMap_Eagle_MouseDownEvent(object sender, AxMapXLib.CMapXEvents_MouseDownEvent e)<BR> {<BR> double MapX=0.0;<BR> double MapY=0.0;<BR> IsMouseDown = true;<BR> axMap_Eagle.ConvertCoord(ref e.x, ref e.y, ref MapX, ref MapY, MapXLib.ConversionConstants.miScreenToMap);<BR> this.axMap_Full.CenterX = MapX;<BR> this.axMap_Full.CenterY = MapY;<BR> <BR> }</DIV> <DIV> private void axMap_Eagle_MouseMoveEvent(object sender, AxMapXLib.CMapXEvents_MouseMoveEvent e)<BR> {<BR> if (IsMouseDown)<BR> {<BR> double MapX = 0.0;<BR> double MapY = 0.0;<BR> axMap_Eagle.ConvertCoord(ref e.x, ref e.y, ref MapX, ref MapY, MapXLib.ConversionConstants.miScreenToMap);<BR> this.axMap_Full.CenterX = MapX;<BR> this.axMap_Full.CenterY = MapY;<BR> }<BR> }</DIV> <DIV> private void axMap_Eagle_MouseUpEvent(object sender, AxMapXLib.CMapXEvents_MouseUpEvent e)<BR> {<BR> IsMouseDown = false;<BR> }</DIV> <DIV> private void axMap_Full_MapViewChanged(object sender, EventArgs e)<BR> {<BR> if (IsEndInit)<BR> InitEagleReigon();//初始化eagle或者根据FullMap的可视改变改变eagle的大小 <BR> }<BR> #endregion</DIV> |
|
2楼#
发布于:2007-04-22 15:29
<P>不是很明白,导航图是什么啊?</P>
|
|
3楼#
发布于:2007-04-22 15:30
<P>有人跟我说用两个容器,分别插入mapx这个控件,然后怎么搞!!</P>
|
|
4楼#
发布于:2007-10-18 17:01
这个都不了解,那得去了解一些基础的东西
|
|