Пример #1
0
        private VectorStyle GetVectorStyle(LandStatus status, bool isOwnLand, bool demandAuthorities, bool ischecked, bool isGreenpeaceUser, bool islockedOnly, bool denouncedByMe)
        {
            Brush fill = null;
            Pen outline = null;

            switch (status)
            {
                case LandStatus.NotChecked:  //STATUS 2 SIN CHEQUEAR
                    fill = new Brush { Color = Color.FromArgb(255, 255, 255, 255) };
                    outline = new Pen { Color = Color.Black, Width = 1 };
                    break;
                case LandStatus.Ok: //STATUS 3 SIN DESMONTES
                    fill = new Brush { Color = Color.FromArgb(143, 121, 136, 35) };
                    outline = new Pen { Color = Color.FromArgb(255, 169, 183, 41), Width = 4 };
                    break;
                case LandStatus.Alert:  //STATUS 4 CON DESMONTES
                     fill = new Brush { Color = Color.FromArgb(143, 255, 236, 0) };
                outline = new Pen { Color = Color.FromArgb(255, 255, 242, 0), Width = 4 };
                    
                    break;
                default: //DEFAULT, IDEM SIN CHEQUEAR
                    fill = new Brush { Color = Color.FromArgb(255, 255, 255, 255) };
                    outline = new Pen { Color = Color.Black, Width = 1 };
                    break;
            }

            if (ischecked && (status == LandStatus.Alert || status == LandStatus.Ok)) //VERIFICADA POR MI DESMONTADA O SIN DESMONTE
            {
                outline = new Pen { Color = Color.FromArgb(0, 0, 0, 0), Width = 1 };
            }

            if (isOwnLand && (status != LandStatus.Alert && status != LandStatus.Ok))  //MI PROPIA LAND
            {
                outline = new Pen { Color = Color.White, Width = 4 };
            }

            if (demandAuthorities)  //LISTA PARA DEMANDAR
            {
                 fill = new Brush { Color = Color.FromArgb(143, 167, 11, 10) };
                 outline = new Pen { Color = Color.FromArgb(255, 217, 7, 7), Width = 4 };

                if (denouncedByMe)
                {
                    outline = new Pen { Color = Color.FromArgb(0, 0, 0, 0), Width = 1 };

                }
            }

            if (!demandAuthorities && islockedOnly)
            {
                outline = new Pen { Color = Color.FromArgb(0, 0, 0, 0), Width = 1 };
            }

            var vStyle = new VectorStyle
            {
                Fill = fill,
                Outline = outline,
            };

            if (opacity == 0)
            {
                vStyle.SetOpacity(0);
            }
            else
            {
                if (Current.Instance.MapControl.Viewport.Resolution > 2.4 || Current.Instance.MapControl.Viewport.Resolution == 0)
                {
                        vStyle.SetOpacity(opacity);
                }
                else
                {
                    vStyle.SetOpacity(0);
                }
            } 

            return vStyle;
        }
Пример #2
0
        private VectorStyle GetVectorStyle(LandStatus status, bool isOwnLand)
        {
            Brush fill;
            Pen outline;

            switch (status)
            {
                case LandStatus.NotChecked:
                    fill = new Brush { Color = Color.White };
                    outline = new Pen { Color = Color.Black, Width = 2 };
                    break;
                case LandStatus.Ok:
                    fill = new Brush { Color = Color.Green };
                    outline = new Pen { Color = Color.Black, Width = 2 };
                    break;
                case LandStatus.Alert:
                    fill = new Brush { Color = Color.Red };
                    outline = new Pen { Color = Color.Black, Width = 2 };
                    break;
                default:
                    fill = new Brush { Color = Color.Orange };
                    outline = new Pen { Color = Color.Black, Width = 2 };
                    break;
            }

            if (isOwnLand)
            {
                outline = new Pen { Color = Color.Orange, Width = 4 };
            }

            var vStyle = new VectorStyle
            {
                Fill = fill,
                Outline = outline,
            };
            vStyle.SetOpacity(opacity);
            return vStyle;
        }