Example #1
0
        private void _donationsRequest_DonationsReceived(object sender, EventArgs e)
        {
            var adopters = sender as List <Adopter>;

            if (adopters == null)
            {
                return;
            }

            DonationsViewerSystem.Instance.MainPage.overviewControl.UpdateOverview(adopters);

            foreach (var adopter in adopters)
            {
                //Create symbols and place it on the map
                var geom = WktConverter.PolygonWktToPolygon(adopter.geom);
                if (geom == null)
                {
                    continue;
                }

                var fillSymbol = new SimpleFillSymbol {
                    BorderBrush = new SolidColorBrush(Colors.Black), BorderThickness = 1, Fill = new SolidColorBrush(GetRandomColor())
                };
                var g = new Graphic {
                    Geometry = geom, Symbol = fillSymbol
                };
                g.Attributes.Add("username", adopter.username);
                g.Attributes.Add("area", adopter.area);
                g.Attributes.Add("amount", adopter.amount);
                Graphics.Add(g);
            }
        }
Example #2
0
        private void _landRequest_DonationsReceived(object sender, EventArgs e)
        {
            var land = sender as List <DonationsLand>;

            if (land == null)
            {
                return;
            }

            foreach (var l in land)
            {
                var geom = WktConverter.PolygonWktToPolygon(l.geom);
                if (geom == null)
                {
                    continue;
                }
                //FFA52A2A
                var fillSymbol = new SimpleFillSymbol {
                    BorderBrush = new SolidColorBrush(Colors.Black), BorderThickness = 1, Fill = new SolidColorBrush(Color.FromArgb(80, 176, 196, 222))
                };
                var g = new Graphic {
                    Geometry = geom, Symbol = fillSymbol
                };
                Graphics.Add(g);
            }
        }