コード例 #1
0
        // 设置设备显示、隐藏
        public void SetDeviceVisible(string deviceName, bool visible)
        {
            IMFLayer layer = mapLogic.GetLayer("设备服务图层");

            if (layer == null)
            {
                return;
            }

            IMFElement element = layer.GetElement(deviceName);

            if (element != null)
            {
                IMFPicture picture = element as IMFPicture;
                if (picture != null)
                {
                    picture.SetVisible(visible);
                }
            }

            IMFElement ele = layer.GetElement(deviceName + "polygon");

            if (ele != null)
            {
                IMFCircle circle = ele as IMFCircle;
                if (circle != null)
                {
                    circle.SetVisible(visible);
                }
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: AnuoF/MapFrame
 private void 显示隐藏ToolStripMenuItem_Click(object sender, System.EventArgs e)
 {
     if (picElement == null)
     {
         return;
     }
     picElement.SetVisible(!picElement.IsVisible);
 }