毕业论文开发语言企业开发JAVA技术.NET技术WEB开发Linux/Unix数据库技术Windows平台移动平台嵌入式论文范文英语论文
您现在的位置: 毕业论文 >> 企业开发 >> 正文

arcgis engine 的鹰眼如何改善

更新时间:2014-11-12:  来源:毕业论文

region 主视图事件.
//同步鹰眼视图和主视图.
private void map_main_OnMapReplaced(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMapReplacedEvent e)
{
    map_view.ClearLayers();
    for (int i = 0; i < map_main.LayerCount; i++) map_view.AddLayer(map_main.get_Layer(i));
    map_view.Extent = map_main.FullExtent;
    map_main.Refresh();
}
//画轮廓.
private void map_main_OnExtentUpdated(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnExtentUpdatedEvent e)
{
    ESRI.ArcGIS.Geometry.IEnvelope enNew = (ESRI.ArcGIS.Geometry.IEnvelope)e.newEnvelope;
    ESRI.ArcGIS.Carto.IGraphicsContainer hawkGC = (ESRI.ArcGIS.Carto.IGraphicsContainer)map_view.Map;
    ESRI.ArcGIS.Carto.IActiveView aView = (ESRI.ArcGIS.Carto.IActiveView)hawkGC;
    hawkGC.DeleteAllElements();
 
    ESRI.ArcGIS.Carto.IElement recEle = (ESRI.ArcGIS.Carto.IElement)new ESRI.ArcGIS.Carto.RectangleElementClass();
    recEle.Geometry = enNew;
    //轮廓线颜色.
    ESRI.ArcGIS.Display.IRgbColor rgbColor = new ESRI.ArcGIS.Display.RgbColorClass();
    rgbColor.RGB = 255;
    rgbColor.Transparency = 255;
    ESRI.ArcGIS.Display.ISimpleLineSymbol outLine = new ESRI.ArcGIS.Display.SimpleLineSymbolClass();
    outLine.Color = rgbColor;
    outLine.Width = 2;
    //填充颜色.
    rgbColor = new ESRI.ArcGIS.Display.RgbColorClass();
    rgbColor.RGB = 255;
    rgbColor.Transparency = 0;
 
    //填充样式.
    ESRI.ArcGIS.Display.ISimpleFillSymbol fillSym = new ESRI.ArcGIS.Display.SimpleFillSymbolClass();
    fillSym.Color = rgbColor;
    fillSym.Outline = outLine;
 
    ESRI.ArcGIS.Carto.IFillShapeElement fillShape = (ESRI.ArcGIS.Carto.IFillShapeElement)recEle;
    fillShape.Symbol = fillSym;
    hawkGC.AddElement((ESRI.ArcGIS.Carto.IElement)fillShape, 0);
    aView.PartialRefresh(ESRI.ArcGIS.Carto.esriViewDrawPhase.esriViewGraphics, null, null);
}
 
#endregion
 
#region 鹰眼事件.
private void map_view_OnMouseDown(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseDownEvent e)
{
    if (map_main.LayerCount < 0) return;
    if (e.button == 1)
    { //点选.
    ESRI.ArcGIS.Geometry.IPoint ptNew = new ESRI.ArcGIS.Geometry.PointClass();
    ptNew.PutCoords(e.mapX, e.mapY);
    map_main.CenterAt(ptNew);
    }
    else if (e.button == 2) //右键框选.
    {  
    map_main.Extent = map_view.TrackRectangle();
    }
    map_main.ActiveView.PartialRefresh(ESRI.ArcGIS.Carto.esriViewDrawPhase.esriViewGeography, null, null);
}
 
private void map_view_OnMouseMove(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseMoveEvent e)
{
    if (e.button == 1)
    {
    ESRI.ArcGIS.Geometry.IPoint ptNew = new ESRI.ArcGIS.Geometry.PointClass();
    ptNew.PutCoords(e.mapX, e.mapY);
    map_main.CenterAt(ptNew);
    map_main.ActiveView.PartialRefresh(ESRI.ArcGIS.Carto.esriViewDrawPhase.esriViewGeography, null, null);
    }
}
#endregion


这代码基本上都是copy的,网上的代码也都差不多,找不到不一样的.

我现在想实现的功能是,鼠标拖动的时候,不实时更新,鼠标方框的时候才更新.
但是问题是,拖动的过程,我想让我画的轮廓跟着鼠标. 这个实现不了...

网上的代码都是copy的,闪动的原因是鼠标拖动过程都进行更新.
如果你看过别人实现鹰眼的代码就知道了.我的思路是拖动过程不更新.鼠标放开才更新.
但是拖动的过程,照样在鹰眼的MapControl中时时更新画的轮廓.
就那么简单.

设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优尔论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。