/// <summary> /// 地图加载就绪事件 /// </summary> /// <param name="e"></param> void iMSMap1_MapReady(IMSMapEvent e) { if (!DesignerProperties.IsInDesignTool) { //初始化查询结果显示控件 layer_dataView = new LayerDataViewer() { activeLayer = this.vectorLayer, GraphicsLayer = this.graphicsLayer }; } }
private void iMSMap1_MapReady(IMSMapEvent e) { if (!DesignerProperties.IsInDesignTool) { //绘图图层 m_gpLayer = new GraphicsLayer(); iMSMap1.AddChild(m_gpLayer); m_gpLayer.EnableGPUMode = true; //添加圆形区域 AddCircle(); this.iMSCatalog1.MapContainer = iMSMap1; } }
/// <summary> /// 地图加载就绪事件 /// </summary> /// <param name="e"></param> void iMSMap1_MapReady(IMSMapEvent e) { if (!DesignerProperties.IsInDesignTool) { //初始化查询结果显示控件 layer_dataView = new LayerDataViewer() { activeLayer = this.vectorLayer, GraphicsLayer = this.graphicsLayer }; //地图容器右键菜单添加一项:取消鼠标状态 this.iMSMap1.SetInfoText(" 选择几何查询类型,然后查询;右键菜单“取消鼠标状态”", Colors.Black); MenuItem item = new MenuItem(); item.Header = "取消鼠标状态"; this.iMSMap1.ContextMenu.Items.Add(item); item.Click += new RoutedEventHandler(item_Click); } }
private void iMSMap1_MapReady(IMSMapEvent e) { if (!DesignerProperties.IsInDesignTool) { if (g_GraphicsLayer == null) { g_GraphicsLayer = new GraphicsLayer(); this.iMSMap1.AddChild(this.g_GraphicsLayer); g_GraphicsLayer.EnableGPUMode = true; } if (g_GraphicsLayer != null) { //添加第一个矩形范围 IMSRect = new IMSRectangle(CoordinateType.Logic); this.g_GraphicsLayer.AddGraphics(IMSRect); //起始点 IMSRect.StartPoint = new Point(114.30829449926757, 30.637357284423828); //结束点 IMSRect.EndPoint = new Point(114.32125563671875, 30.64560111743164); IMSRect.Draw(); //添加第二个矩形范围 IMSRect2 = new IMSRectangle(CoordinateType.Logic); this.g_GraphicsLayer.AddGraphics(IMSRect2); //起始点 IMSRect2.StartPoint = new Point(114.3189198840332, 30.63515892895508); //结束点 IMSRect2.EndPoint = new Point(114.32991166137695, 30.64738728125); IMSRect2.Draw(); //Rect对象存储第一个矩形的范围 rect1 = new ZDIMS.BaseLib.Rect(); rect1.xmin = 114.30829449926757; rect1.xmax = 114.32125563671875; rect1.ymin = 30.637357284423828; rect1.ymax = 30.64560111743164; //Rect对象存储第二个矩形范围 rect2 = new ZDIMS.BaseLib.Rect(); rect2.xmin = 114.3189198840332; rect2.xmax = 114.32991166137695; rect2.ymin = 30.63515892895508; rect2.ymax = 30.64738728125; this.iMSCatalog1.MapContainer = iMSMap1; } } }
/// <summary> /// 地图加载就绪事件 /// </summary> /// <param name="e"></param> void iMSMap1_MapReady(IMSMapEvent e) { if (!DesignerProperties.IsInDesignTool) { //初始化查询结果显示控件 layer_dataView = new LayerDataViewer() { activeLayer = this.vectorLayer, GraphicsLayer = this.graphicsLayer }; //设置图层状态 CSetEnumLayerStatus setLayerStatus; //设置状态更新参数 setLayerStatus = new CSetEnumLayerStatus(); setLayerStatus.GdbIndex = 0;//图层所在gdb数据库索引号 //设置索引号为0的图层状态:可查询 setLayerStatus.LayerStatus = new EnumLayerStatus[1]; setLayerStatus.LayerStatus[0] = EnumLayerStatus.Editable; //调用矢量图层的设置图层状态方法,设置图层状态 this.vectorLayer.SetEnumLayerStatus(setLayerStatus, onSetSingleLayerStatus); } }
void iMSMap1_MapReady(IMSMapEvent e) { if (!DesignerProperties.IsInDesignTool) { IMSMark mark = new IMSMark(new Image() { Source = new BitmapImage(new Uri("images/pin.png", UriKind.Relative)), Width = 36, Height = 48 }, ZDIMS.Interface.CoordinateType.Logic) { X = 114.125686114315, Y = 30.4582609083728, EnableDrag = true }; markLayer1.AddMark(mark); int totalNumber = 50; int count = 0; double xMin = 114.125686114315; double yMin = 30.4582609083728; double xMax = 114.500788705197; double yMax = 30.7085740673183; double centerX = (xMin + xMax) / 2; double centerY = (yMin + yMax) / 2; Point pnt; //IMSMark mark; Random rnd = new Random(); markLayer1.EnableZoomAnimation = true; markLayer1.EnableMarkHiden = false; markLayer1.EnablePolymericMark = true; int n = 1; while (count < totalNumber) { pnt = GetRandomCoordinate(rnd.Next(0, 1000) + rnd.Next(0, 100) + rnd.Next(0, 10), centerX, centerY, 0.025); centerX = pnt.X; centerY = pnt.Y; if (centerX > xMin && centerX < xMax && centerY > yMin && centerY < yMax) { count++; mark = new IMSMark(new Image() { Source = new BitmapImage(new Uri("/images/mark/p" + n.ToString() + ".png", UriKind.Relative)), Width = 16, Height = 18 }, CoordinateType.Logic, markLayer1); mark.X = centerX; //114.28793904776113;// mark.Y = centerY; //30.549563956006946;// //mark.EnableDrag = true; markLayer1.AddMark(mark); //mark.Flicker(400, 10); n = (++n) % 8 > 0 ? n % 8 : 1; } else { centerX = (xMin + xMax) / 2; centerY = (yMin + yMax) / 2; } } markLayer1.InitPolymericMark(); } }
private void iMSMap1_MapReady(IMSMapEvent e) { initMark(); }
private void onOperTypeChange(IMSMapEvent e) { this.m_mapContainer.MouseMove -= new MouseEventHandler(m_graphicsLayer_MouseMove); this.m_mapContainer.MapOperTypeChange -= new IMSMapEventHandler(onOperTypeChange); clearMeasurePnts(null, null, null); }