Exemplo n.º 1
0
        private void ShowUsa()
        {
            var values = new Dictionary <string, double>();
            ProbabilityCalculator pc     = new ProbabilityCalculator();
            List <City>           cities = pc.GetAllCities("usa");

            foreach (var cur in cities)
            {
                values[cur.Id] = cur.Probability;
            }

            gm_France.GradientStopCollection = new GradientStopCollection
            {
                new GradientStop(System.Windows.Media.Color.FromRgb(30, 144, 255), 0),
                new GradientStop(System.Windows.Media.Color.FromRgb(0, 255, 0), .25),
                new GradientStop(System.Windows.Media.Color.FromRgb(240, 128, 128), .5),
                new GradientStop(System.Windows.Media.Color.FromRgb(255, 0, 0), .75),
                new GradientStop(System.Windows.Media.Color.FromRgb(139, 0, 0), 1)
            };

            gm_USA.EnableZoomingAndPanning = true;
            gm_USA.HeatMap = values;
            gm_USA.Source  = "Maps/United States of America.xml";
            gm_USA.Visible = true;
            gm_USA.Visible = true;
            gm_USA.Update();
        }
Exemplo n.º 2
0
        private void ShowCountry()
        {
            var values = new Dictionary <string, double>();
            ProbabilityCalculator pc        = new ProbabilityCalculator();
            List <Country>        countries = pc.GetAllCountry();

            foreach (var cur in countries)
            {
                values[cur.Id] = cur.Probability;
            }

            gm_Country.GradientStopCollection = new GradientStopCollection
            {
                new GradientStop(System.Windows.Media.Color.FromRgb(30, 144, 255), 0),
                new GradientStop(System.Windows.Media.Color.FromRgb(0, 255, 0), .25),
                new GradientStop(System.Windows.Media.Color.FromRgb(240, 128, 128), .5),
                new GradientStop(System.Windows.Media.Color.FromRgb(255, 0, 0), .75),
                new GradientStop(System.Windows.Media.Color.FromRgb(139, 0, 0), 1)
            };

            gm_Country.EnableZoomingAndPanning = true;
            gm_Country.HeatMap = values;
            gm_Country.Source  = "Maps/World.xml";
            gm_Country.Visible = true;
            gm_Country.Update();
        }