コード例 #1
0
ファイル: WarnManager.cs プロジェクト: siszoey/MapFrame
        private void SetAreaColorArcMap(string name, Color color)
        {
            IMFLayer layer = mapMapLogic.GetLayer(layerName);

            if (layer == null)
            {
                return;
            }

            IMFElement element = layer.GetElement(name);

            if (element == null)
            {
                return;
            }

            IMFPolygon polygon = element as IMFPolygon;

            if (polygon == null)
            {
                return;
            }

            polygon.SetFillColor(Color.FromArgb(80, color));
        }
コード例 #2
0
        private void SetGlobeElementColor(string layerName, string elementName, Color color, bool isSatellite)
        {
            var layer = globeBusiness.mapLogic.GetLayer(layerName);

            if (layer == null)
            {
                return;
            }
            var ele = layer.GetElement(elementName);

            if (ele == null)
            {
                return;
            }

            if (isSatellite)
            {
                I3DModel model = ele as I3DModel;
                if (model == null)
                {
                    return;
                }

                model.SetColor(color);
            }
            else
            {
                IMFPolygon polygon = ele as IMFPolygon;
                if (polygon == null)
                {
                    return;
                }
                polygon.SetFillColor(color);
            }
        }
コード例 #3
0
ファイル: WarnManager.cs プロジェクト: siszoey/MapFrame
        private void SetAreaColorGlobe(string name, Color color)
        {
            IMFLayer layer = globeMapLogic.GetLayer(layerName);

            if (layer == null)
            {
                return;
            }

            foreach (string polygonName in warnAresDic[name].Polygons)
            {
                var element = layer.GetElement(polygonName);
                if (element == null)
                {
                    continue;
                }

                IMFPolygon polygon = element as IMFPolygon;
                if (polygon == null)
                {
                    continue;
                }
                Color c = Color.FromArgb(80, color.R, color.G, color.B);
                polygon.SetFillColor(c);
            }

            layer.Refresh();
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: AnuoF/MapFrame
 private void 设置填充色ToolStripMenuItem_Click(object sender, System.EventArgs e)
 {
     if (polygonElement == null)
     {
         return;
     }
     polygonElement.SetFillColor(Color.Yellow);
 }