Example #1
0
        void SetColorMapping(SFShapeSetting setting)
        {
            ObservableCollection <SFMapColorMapping> colorMappings = new ObservableCollection <SFMapColorMapping>  ();
            SFEqualColorMapping colorMapping1 = new SFEqualColorMapping();

            colorMapping1.Value       = (NSString)"Vegetables";
            colorMapping1.LegendLabel = (NSString)"Vegetables";
            colorMapping1.Color       = UIColor.FromRGB(0x29, 0xBB, 0x9C);
            colorMappings.Add(colorMapping1);

            SFEqualColorMapping colorMapping2 = new SFEqualColorMapping();

            colorMapping2.Value       = (NSString)"Rice";
            colorMapping2.LegendLabel = (NSString)"Rice";
            colorMapping2.Color       = UIColor.FromRGB(0xFD, 0x8C, 0x48);
            colorMappings.Add(colorMapping2);

            SFEqualColorMapping colorMapping3 = new SFEqualColorMapping();

            colorMapping3.Value       = (NSString)"Wheat";
            colorMapping3.LegendLabel = (NSString)"Wheat";
            colorMapping3.Color       = UIColor.FromRGB(0xE5, 0x4D, 0x42);
            colorMappings.Add(colorMapping3);

            SFEqualColorMapping colorMapping4 = new SFEqualColorMapping();

            colorMapping4.Value       = (NSString)"Grains";
            colorMapping4.LegendLabel = (NSString)"Grains";
            colorMapping4.Color       = UIColor.FromRGB(0x3A, 0x99, 0xD9);
            colorMappings.Add(colorMapping4);

            setting.ColorMappings = colorMappings;
        }
        void SetColorMapping(SFShapeSetting setting)
        {
            NSMutableArray      colorMappings = new NSMutableArray();
            SFEqualColorMapping colorMapping1 = new SFEqualColorMapping();

            colorMapping1.Value = (NSString)"1";
            colorMapping1.Color = UIColor.FromRGB(255, 165, 0);
            colorMappings.Add(colorMapping1);

            SFEqualColorMapping colorMapping2 = new SFEqualColorMapping();

            colorMapping2.Value = (NSString)"2";
            colorMapping2.Color = UIColor.FromRGB(255, 165, 0);
            colorMappings.Add(colorMapping2);

            SFEqualColorMapping colorMapping3 = new SFEqualColorMapping();

            colorMapping3.Value = (NSString)"8";
            colorMapping3.Color = UIColor.FromRGB(255, 165, 0);
            colorMappings.Add(colorMapping3);

            SFEqualColorMapping colorMapping4 = new SFEqualColorMapping();

            colorMapping4.Value = (NSString)"9";
            colorMapping4.Color = UIColor.FromRGB(255, 165, 0);
            colorMappings.Add(colorMapping4);

            setting.ColorMappings = colorMappings;
        }
Example #3
0
        void SetColorMapping(SFShapeSetting setting)
        {
            ObservableCollection <SFMapColorMapping> colorMappings = new ObservableCollection <SFMapColorMapping>();
            SFEqualColorMapping colorMapping1 = new SFEqualColorMapping();

            colorMapping1.Value = (NSString)"1";
            colorMapping1.Color = UIColor.FromRGB(255, 165, 0);
            colorMappings.Add(colorMapping1);

            SFEqualColorMapping colorMapping2 = new SFEqualColorMapping();

            colorMapping2.Value = (NSString)"2";
            colorMapping2.Color = UIColor.FromRGB(255, 165, 0);
            colorMappings.Add(colorMapping2);

            SFEqualColorMapping colorMapping3 = new SFEqualColorMapping();

            colorMapping3.Value = (NSString)"8";
            colorMapping3.Color = UIColor.FromRGB(255, 165, 0);
            colorMappings.Add(colorMapping3);

            SFEqualColorMapping colorMapping4 = new SFEqualColorMapping();

            colorMapping4.Value = (NSString)"9";
            colorMapping4.Color = UIColor.FromRGB(255, 165, 0);
            colorMappings.Add(colorMapping4);

            setting.ColorMappings = colorMappings;
        }
Example #4
0
        public DataLabels()
        {
            smartLabelMode      = new UIPickerView();
            intersectActionMode = new UIPickerView();

            SFMap maps = new SFMap();

            view          = new UIView();
            view.Frame    = new CGRect(0, 0, 300, 400);
            busyindicator = new SfBusyIndicator();
            busyindicator.ViewBoxWidth  = 75;
            busyindicator.ViewBoxHeight = 75;
            busyindicator.Foreground    = UIColor.FromRGB(0x77, 0x97, 0x72); /*#779772*/
            busyindicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeSlicedCircle;
            view.AddSubview(busyindicator);

            NSTimer.CreateScheduledTimer(TimeSpan.FromSeconds(0.3), delegate {
                if (isDisposed)
                {
                    return;
                }
                maps.Frame = new CGRect(Frame.Location.X, 60, Frame.Size.Width - 6, Frame.Size.Height - 60);

                view.AddSubview(maps);
            });

            layer = new SFShapeFileLayer();

            layer.Uri               = (NSString)NSBundle.MainBundle.PathForResource("usa_state", "shp");
            layer.ShapeIDPath       = (NSString)"Name";
            layer.ShapeIDTableField = (NSString)"STATE_NAME";
            layer.ShowMapItems      = true;
            layer.DataSource        = GetDataSource();

            SFShapeSetting shapeSettings = new SFShapeSetting();

            shapeSettings.ColorValuePath = (NSString)"Type";
            shapeSettings.ValuePath      = (NSString)"Name";
            shapeSettings.Fill           = UIColor.FromRGB(169, 217, 247);
            SetColorMapping(shapeSettings);
            layer.ShapeSettings = shapeSettings;

            layer.TooltipSettings.ShowTooltip = true;
            layer.TooltipSettings.ValuePath   = (NSString)"Name";

            SFDataLabelSetting dataLabelSetting = new SFDataLabelSetting();

            dataLabelSetting.SmartLabelMode     = IntersectAction.Trim;
            dataLabelSetting.IntersectionAction = IntersectAction.None;
            layer.DataLabelSettings             = dataLabelSetting;

            maps.Layers.Add(layer);
            AddSubview(view);
            CreateOptionView();
            this.OptionView = option;
            maps.Delegate   = new MapsDataLabelsDelegate(this);
        }
Example #5
0
        public Sublayer()
        {
            SFMap maps = new SFMap();

            view          = new UIView();
            view.Frame    = new CGRect(0, 0, 300, 400);
            busyindicator = new SfBusyIndicator();
            busyindicator.ViewBoxWidth  = 75;
            busyindicator.ViewBoxHeight = 75;
            busyindicator.Foreground    = UIColor.FromRGB(0x77, 0x97, 0x72); /*#779772*/
            busyindicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeSlicedCircle;
            view.AddSubview(busyindicator);
            label = new UILabel();
            label.TextAlignment = UITextAlignment.Center;
            label.Text          = "Rivers in Australia";
            label.Font          = UIFont.SystemFontOfSize(18);
            label.Frame         = new CGRect(0, 0, 400, 40);
            label.TextColor     = UIColor.Black;
            view.AddSubview(label);

            NSTimer.CreateScheduledTimer(TimeSpan.FromSeconds(0.3), delegate {
                if (isDisposed)
                {
                    return;
                }
                maps.Frame = new CGRect(Frame.Location.X, 60, Frame.Size.Width - 6, Frame.Size.Height - 60);

                view.AddSubview(maps);
            });

            SFShapeFileLayer layer = new SFShapeFileLayer();

            layer.Uri = (NSString)NSBundle.MainBundle.PathForResource("australia", "shp");

            SFShapeSetting shapeSettings = new SFShapeSetting();

            shapeSettings.StrokeThickness = 1;
            shapeSettings.StrokeColor     = UIColor.White;
            shapeSettings.Fill            = UIColor.FromRGB(172, 249, 247);
            layer.ShapeSettings           = shapeSettings;

            SFShapeFileLayer subLayer = new SFShapeFileLayer();

            subLayer.Uri = (NSString)NSBundle.MainBundle.PathForResource("river", "shp");
            SFShapeSetting subLayerSettings = new SFShapeSetting();

            subLayerSettings.StrokeThickness = 2;
            subLayerSettings.Fill            = UIColor.FromRGB(0, 168, 204);
            subLayer.ShapeSettings           = subLayerSettings;

            layer.Sublayers.Add(subLayer);

            maps.Layers.Add(layer);
            AddSubview(view);
            maps.Delegate = new MapsSublayerDelegate(this);
        }
        public BubbleVisualization()
        {
            SFMap maps = new SFMap();

            view          = new UIView();
            view.Frame    = new CGRect(0, 0, 300, 400);
            busyindicator = new SFBusyIndicator();
            busyindicator.ViewBoxWidth  = 75;
            busyindicator.ViewBoxHeight = 75;
            busyindicator.Foreground    = UIColor.FromRGB(0x77, 0x97, 0x72);            /*#779772*/
            busyindicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeSlicedCircle;
            view.AddSubview(busyindicator);
            label = new UILabel();
            label.TextAlignment = UITextAlignment.Center;
            label.Text          = "Top Population Countries With Bubbles";
            label.Font          = UIFont.SystemFontOfSize(18);
            label.Frame         = new  CGRect(0, 0, 300, 40);
            label.TextColor     = UIColor.Black;
            view.AddSubview(label);

            NSTimer.CreateScheduledTimer(TimeSpan.FromSeconds(0.3), delegate {
                maps.Frame = new CGRect(Frame.Location.X, 60, Frame.Size.Width - 6, Frame.Size.Height - 60);

                view.AddSubview(maps);
            });

            SFShapeFileLayer layer = new SFShapeFileLayer();

            layer.Uri = (NSString)NSBundle.MainBundle.PathForResource("world1", "shp");

            layer.DataSource = GetDataSource();

            SFBubbleMarkerSetting marker = new SFBubbleMarkerSetting();

            marker.MaxSize   = 75;
            marker.MinSize   = 55;
            marker.ValuePath = (NSString)"Population";
            SFShapeSetting shapeSettings = new SFShapeSetting();

            shapeSettings.valuePath   = (NSString)"Country";
            shapeSettings.Fill        = UIColor.FromRGB(0xA9, 0xD9, 0xF7);
            shapeSettings.StrokeColor = UIColor.White;
            layer.ShapeSettings       = shapeSettings;
            layer.ShowMapItems        = true;
            layer.BubbleMarkerSetting = marker;
            maps.Layers.Add(layer);
            AddSubview(view);
            maps.Delegate = new MapsBubbleDelegate(this);

            control = this;
        }
		public BubbleVisualization ()
		{
			SFMap maps = new SFMap ();
			view = new UIView ();
			view.Frame=new CGRect(0,0,300,400);
			busyindicator = new SFBusyIndicator ();
			busyindicator.ViewBoxWidth=75;
			busyindicator.ViewBoxHeight=75;
			busyindicator.Foreground=  UIColor.FromRGB (0x77, 0x97, 0x72);  /*#779772*/
			busyindicator.AnimationType=SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeSlicedCircle;
			view.AddSubview (busyindicator);
			label = new UILabel ();
			label.TextAlignment = UITextAlignment.Center;
			label.Text = "Top Population Countries With Bubbles";
			label.Font = UIFont.SystemFontOfSize (18);
			label.Frame=new  CGRect(0,0,300,40);
			label.TextColor = UIColor.Black;
			view.AddSubview (label);

			NSTimer.CreateScheduledTimer (TimeSpan.FromSeconds (0.3), delegate {
				maps.Frame = new CGRect(Frame.Location.X,60,Frame.Size.Width-6,Frame.Size.Height-60);

				view.AddSubview (maps);
			});

			SFShapeFileLayer layer = new SFShapeFileLayer ();
		
			layer.Uri = (NSString)NSBundle.MainBundle.PathForResource ("world1", "shp");

			layer.DataSource = GetDataSource();

			SFBubbleMarkerSetting marker = new SFBubbleMarkerSetting ();
			marker.MaxSize = 75;
			marker.MinSize = 55;
			marker.ValuePath = (NSString)"Population";
			SFShapeSetting shapeSettings = new SFShapeSetting ();
			shapeSettings.valuePath = (NSString)"Country";
			shapeSettings.Fill = UIColor.FromRGB (0xA9,0xD9,0xF7);
			shapeSettings.StrokeColor = UIColor.White;
			layer.ShapeSettings = shapeSettings;
			layer.ShowMapItems = true;
			layer.BubbleMarkerSetting = marker;
			maps.Layers.Add (layer);
			AddSubview (view);
			maps.Delegate = new MapsBubbleDelegate (this);

			control = this;
		}
Example #8
0
        void SetColorMapping(SFShapeSetting setting)
        {
            ObservableCollection <SFMapColorMapping> colorMappings = new ObservableCollection <SFMapColorMapping>();

            SFEqualColorMapping colorMapping1 = new SFEqualColorMapping();

            colorMapping1.Value = (NSString)"North America";
            colorMapping1.Color = UIColor.FromRGB(193, 54, 100);
            colorMappings.Add(colorMapping1);

            SFEqualColorMapping colorMapping2 = new SFEqualColorMapping();

            colorMapping2.Value = (NSString)"South America";
            colorMapping2.Color = UIColor.FromRGB(156, 51, 103);
            colorMappings.Add(colorMapping2);

            SFEqualColorMapping colorMapping3 = new SFEqualColorMapping();

            colorMapping3.Value = (NSString)"Africa";
            colorMapping3.Color = UIColor.FromRGB(128, 48, 106);
            colorMappings.Add(colorMapping3);

            SFEqualColorMapping colorMapping4 = new SFEqualColorMapping();

            colorMapping4.Value = (NSString)"Europe";
            colorMapping4.Color = UIColor.FromRGB(98, 45, 108);
            colorMappings.Add(colorMapping4);

            SFEqualColorMapping colorMapping5 = new SFEqualColorMapping();

            colorMapping5.Value = (NSString)"Asia";
            colorMapping5.Color = UIColor.FromRGB(70, 42, 109);
            colorMappings.Add(colorMapping5);

            SFEqualColorMapping colorMapping6 = new SFEqualColorMapping();

            colorMapping6.Value = (NSString)"Australia";
            colorMapping6.Color = UIColor.FromRGB(42, 40, 112);
            colorMappings.Add(colorMapping6);

            setting.ColorMappings = colorMappings;
        }
Example #9
0
        public DataLabels()
        {
            smartLabelMode      = new UIPickerView();
            intersectActionMode = new UIPickerView();

            maps       = new SFMap();
            view       = new UIView();
            view.Frame = new CGRect(0, 0, 300, 400);


            layer = new SFShapeFileLayer();

            layer.Uri               = (NSString)NSBundle.MainBundle.PathForResource("usa_state", "shp");
            layer.ShapeIDPath       = (NSString)"Name";
            layer.ShapeIDTableField = (NSString)"STATE_NAME";
            layer.ShowMapItems      = true;
            layer.DataSource        = GetDataSource();

            SFShapeSetting shapeSettings = new SFShapeSetting();

            shapeSettings.ColorValuePath = (NSString)"Type";
            shapeSettings.ValuePath      = (NSString)"Name";
            shapeSettings.Fill           = UIColor.FromRGB(169, 217, 247);
            SetColorMapping(shapeSettings);
            layer.ShapeSettings = shapeSettings;

            SFDataLabelSetting dataLabelSetting = new SFDataLabelSetting();

            dataLabelSetting.SmartLabelMode     = IntersectAction.Trim;
            dataLabelSetting.IntersectionAction = IntersectAction.None;
            layer.DataLabelSettings             = dataLabelSetting;

            maps.Layers.Add(layer);
            AddSubview(view);
            CreateOptionView();
            this.OptionView = option;
        }
        void SetColorMapping(SFShapeSetting setting)
        {
            ObservableCollection <SFMapColorMapping> colorMappings = new ObservableCollection <SFMapColorMapping>();

            SFEqualColorMapping colorMapping1 = new SFEqualColorMapping();

            colorMapping1.Value = (NSString)"Rice";
            colorMapping1.Color = UIColor.FromRGB(181, 228, 133);
            colorMappings.Add(colorMapping1);

            SFEqualColorMapping colorMapping2 = new SFEqualColorMapping();

            colorMapping2.Value = (NSString)"Vegetables";
            colorMapping2.Color = UIColor.FromRGB(236, 155, 121);
            colorMappings.Add(colorMapping2);

            SFEqualColorMapping colorMapping3 = new SFEqualColorMapping();

            colorMapping3.Value = (NSString)"Wheat";
            colorMapping3.Color = UIColor.FromRGB(145, 120, 227);
            colorMappings.Add(colorMapping3);

            SFEqualColorMapping colorMapping4 = new SFEqualColorMapping();

            colorMapping4.Value = (NSString)"Grains";
            colorMapping4.Color = UIColor.FromRGB(228, 193, 108);
            colorMappings.Add(colorMapping4);

            SFEqualColorMapping colorMapping5 = new SFEqualColorMapping();

            colorMapping5.Value = (NSString)"Oats";
            colorMapping5.Color = UIColor.FromRGB(223, 129, 156);
            colorMappings.Add(colorMapping5);

            setting.ColorMappings = colorMappings;
        }
        public BubbleVisualization()
        {
            maps       = new SFMap();
            view       = new UIView();
            view.Frame = new CGRect(0, 0, 300, 400);

            label = new UILabel();
            label.TextAlignment = UITextAlignment.Center;
            label.Text          = "Top 40 Population Countries With Bubbles";
            label.Font          = UIFont.SystemFontOfSize(18);
            label.Frame         = new  CGRect(0, 0, 400, 40);
            label.TextColor     = UIColor.Black;
            view.AddSubview(label);


            SFShapeFileLayer layer = new SFShapeFileLayer();

            layer.Uri               = (NSString)NSBundle.MainBundle.PathForResource("world1", "shp");
            layer.ShapeIDPath       = (NSString)"Country";
            layer.ShapeIDTableField = (NSString)"NAME";
            layer.ShowMapItems      = true;
            layer.DataSource        = GetDataSource();

            SFShapeSetting shapeSettings = new SFShapeSetting();

            shapeSettings.Fill  = UIColor.LightGray;
            layer.ShapeSettings = shapeSettings;

            SFBubbleMarkerSetting marker = new SFBubbleMarkerSetting();

            marker.ValuePath      = (NSString)"Percent";
            marker.ColorValuePath = (NSString)"Percent";

            ObservableCollection <SFMapColorMapping> colorMappings = new ObservableCollection <SFMapColorMapping>();

            SFRangeColorMapping rangeColorMapping1 = new SFRangeColorMapping();

            rangeColorMapping1.To          = 20;
            rangeColorMapping1.From        = 4;
            rangeColorMapping1.LegendLabel = (NSString)"Above 4%";
            rangeColorMapping1.Color       = UIColor.FromRGB(46, 118, 159);
            colorMappings.Add(rangeColorMapping1);

            SFRangeColorMapping rangeColorMapping2 = new SFRangeColorMapping();

            rangeColorMapping2.To          = 4;
            rangeColorMapping2.From        = 2;
            rangeColorMapping2.LegendLabel = (NSString)"4% - 2%";
            rangeColorMapping2.Color       = UIColor.FromRGB(216, 68, 68);
            colorMappings.Add(rangeColorMapping2);

            SFRangeColorMapping rangeColorMapping3 = new SFRangeColorMapping();

            rangeColorMapping3.To          = 2;
            rangeColorMapping3.From        = 1;
            rangeColorMapping3.LegendLabel = (NSString)"2% - 1%";
            rangeColorMapping3.Color       = UIColor.FromRGB(129, 111, 40);
            colorMappings.Add(rangeColorMapping3);

            SFRangeColorMapping rangeColorMapping4 = new SFRangeColorMapping();

            rangeColorMapping4.To          = 1;
            rangeColorMapping4.From        = 0;
            rangeColorMapping4.LegendLabel = (NSString)"Below 1%";
            rangeColorMapping4.Color       = UIColor.FromRGB(127, 56, 160);
            colorMappings.Add(rangeColorMapping4);

            marker.ColorMappings = colorMappings;

            layer.BubbleMarkerSetting = marker;

            SFMapLegendSettings mapLegendSettings = new SFMapLegendSettings();

            mapLegendSettings.ShowLegend = true;
            mapLegendSettings.LegendType = LegendType.Bubbles;

            layer.LegendSettings = mapLegendSettings;

            maps.Layers.Add(layer);


            label2 = new UILabel();
            label2.TextAlignment = UITextAlignment.Center;
            var text1 = new NSString("en.wikipedia.org");

            label2.Text = text1;
            label2.Font = UIFont.SystemFontOfSize(12);
            var stringAtribute = new NSDictionary(UIStringAttributeKey.Font, label2.Font,
                                                  UIStringAttributeKey.ForegroundColor, UIColor.FromRGB(0, 191, 255));
            UIStringAttributes strAtr1 = new UIStringAttributes(stringAtribute);

            label2Size       = text1.GetSizeUsingAttributes(strAtr1);
            label2.TextColor = UIColor.FromRGB(0, 191, 255);
            label2.Frame     = new CGRect(Frame.Size.Width, Frame.Size.Height - 20, 100, 20);
            label2.UserInteractionEnabled = true;
            UITapGestureRecognizer tapGesture = new UITapGestureRecognizer();

            tapGesture.ShouldReceiveTouch += TapGesture_ShouldReceiveTouch;
            label2.AddGestureRecognizer(tapGesture);

            view.AddSubview(label2);

            AddSubview(view);
        }
Example #12
0
        public BubbleVisualization()
        {
            SFMap maps = new SFMap();

            view          = new UIView();
            view.Frame    = new CGRect(0, 0, 300, 400);
            busyindicator = new SFBusyIndicator();
            busyindicator.ViewBoxWidth  = 75;
            busyindicator.ViewBoxHeight = 75;
            busyindicator.Foreground    = UIColor.FromRGB(0x77, 0x97, 0x72); /*#779772*/
            busyindicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeSlicedCircle;
            view.AddSubview(busyindicator);
            label = new UILabel();
            label.TextAlignment = UITextAlignment.Center;
            label.Text          = "Top 40 Population Countries With Bubbles";
            label.Font          = UIFont.SystemFontOfSize(18);
            label.Frame         = new CGRect(0, 0, 400, 40);
            label.TextColor     = UIColor.Black;
            view.AddSubview(label);

            NSTimer.CreateScheduledTimer(TimeSpan.FromSeconds(0.3), delegate
            {
                maps.Frame = new CGRect(Frame.Location.X, 60, Frame.Size.Width - 6, Frame.Size.Height - 60);

                view.AddSubview(maps);
            });

            SFShapeFileLayer layer = new SFShapeFileLayer();

            layer.Uri               = (NSString)NSBundle.MainBundle.PathForResource("world1", "shp");
            layer.ShapeIDPath       = (NSString)"Country";
            layer.ShapeIDTableField = (NSString)"NAME";
            layer.ShowMapItems      = true;
            layer.DataSource        = GetDataSource();

            SFShapeSetting shapeSettings = new SFShapeSetting();

            shapeSettings.Fill  = UIColor.LightGray;
            layer.ShapeSettings = shapeSettings;

            SFBubbleMarkerSetting marker = new SFBubbleMarkerSetting();

            marker.ValuePath      = (NSString)"Population";
            marker.ColorValuePath = (NSString)"Population";

            ObservableCollection <SFMapColorMapping> colorMappings = new ObservableCollection <SFMapColorMapping>();

            SFRangeColorMapping rangeColorMapping1 = new SFRangeColorMapping();

            rangeColorMapping1.To          = 1400000000;
            rangeColorMapping1.From        = 325000000;
            rangeColorMapping1.LegendLabel = (NSString)"Above 4%";
            rangeColorMapping1.Color       = UIColor.FromRGB(46, 118, 159);
            colorMappings.Add(rangeColorMapping1);

            SFRangeColorMapping rangeColorMapping2 = new SFRangeColorMapping();

            rangeColorMapping2.To          = 325000000;
            rangeColorMapping2.From        = 180000000;
            rangeColorMapping2.LegendLabel = (NSString)"4% - 2%";
            rangeColorMapping2.Color       = UIColor.FromRGB(216, 68, 68);
            colorMappings.Add(rangeColorMapping2);

            SFRangeColorMapping rangeColorMapping3 = new SFRangeColorMapping();

            rangeColorMapping3.To          = 180000000;
            rangeColorMapping3.From        = 100000000;
            rangeColorMapping3.LegendLabel = (NSString)"2% - 1%";
            rangeColorMapping3.Color       = UIColor.FromRGB(129, 111, 40);
            colorMappings.Add(rangeColorMapping3);

            SFRangeColorMapping rangeColorMapping4 = new SFRangeColorMapping();

            rangeColorMapping4.To          = 100000000;
            rangeColorMapping4.From        = 5000000;
            rangeColorMapping4.LegendLabel = (NSString)"Below 1%";
            rangeColorMapping4.Color       = UIColor.FromRGB(127, 56, 160);
            colorMappings.Add(rangeColorMapping4);

            marker.ColorMappings      = colorMappings;
            layer.BubbleMarkerSetting = marker;

            SFMapLegendSettings mapLegendSettings = new SFMapLegendSettings();

            mapLegendSettings.ShowLegend = true;
            mapLegendSettings.LegendType = LegendType.Bubbles;
            mapLegendSettings.IconSize   = new CGSize(15, 15);
            mapLegendSettings.Position   = new CGPoint(50, 5);
            mapLegendSettings.TextSize   = 15;
            layer.LegendSettings         = mapLegendSettings;

            maps.Layers.Add(layer);
            AddSubview(view);
            maps.Delegate = new MapsBubbleDelegate(this);
        }
		void SetColorMapping(SFShapeSetting setting)
		{
			NSMutableArray colorMappings = new NSMutableArray ();
			SFEqualColorMapping colorMapping1= new SFEqualColorMapping();
			colorMapping1.Value= (NSString)"Vegetables";
			colorMapping1.LegendLabel= (NSString)"Vegetables";
			colorMapping1.Color =  UIColor.FromRGB (0x29, 0xBB, 0x9C);
			colorMappings.Add(colorMapping1);

			SFEqualColorMapping colorMapping2= new SFEqualColorMapping();
			colorMapping2.Value=(NSString) "Rice";
			colorMapping2.LegendLabel= (NSString)"Rice";
			colorMapping2.Color = UIColor.FromRGB (0xFD, 0x8C, 0x48);
			colorMappings.Add(colorMapping2);

			SFEqualColorMapping colorMapping3= new SFEqualColorMapping();
			colorMapping3.Value=(NSString) "Wheat";
			colorMapping3.LegendLabel= (NSString)"Wheat";
			colorMapping3.Color =UIColor.FromRGB (0xE5, 0x4D, 0x42);
			colorMappings.Add(colorMapping3);

			SFEqualColorMapping colorMapping4= new SFEqualColorMapping();
			colorMapping4.Value= (NSString)"Grains";
			colorMapping4.LegendLabel= (NSString)"Grains";
			colorMapping4.Color =UIColor.FromRGB (0x3A, 0x99, 0xD9);
			colorMappings.Add(colorMapping4);

			setting.ColorMappings = colorMappings;
		}
Example #14
0
        public Drilldown()
        {
            maps = new SFMap();
            maps.EnableZooming = false;
            view = new UIView();

            view.Frame    = new CGRect(0, 0, 300, 400);
            busyindicator = new SFBusyIndicator();
            busyindicator.ViewBoxWidth  = 75;
            busyindicator.ViewBoxHeight = 75;
            busyindicator.Foreground    = UIColor.FromRGB(0x77, 0x97, 0x72); /*#779772*/
            busyindicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeSlicedCircle;
            view.AddSubview(busyindicator);

            layout       = new UIView();
            layout.Frame = new CGRect(0, 0, 300, 50);

            button                        = new UIButton();
            button.Frame                  = new CGRect(0, 0, 100, 50);
            button.TouchUpInside         += Button_TouchUpInside;
            button.BackgroundColor        = UIColor.Clear;
            button.UserInteractionEnabled = true;
            button.Hidden                 = true;

            view.AddSubview(button);

            label = new UILabel();
            label.TextAlignment = UITextAlignment.Center;
            label.Text          = "World Map";
            label.TextColor     = UIColor.Blue;
            label.Font          = UIFont.SystemFontOfSize(18);
            label.Frame         = new CGRect(0, 0, 100, 50);

            layout.AddSubview(label);

            label1 = new UILabel();
            label1.TextAlignment = UITextAlignment.Center;
            label1.Text          = " >> ";
            label1.Font          = UIFont.SystemFontOfSize(18);
            label1.Frame         = new CGRect(80, 0, 50, 50);

            layout.AddSubview(label1);

            label3 = new UILabel();
            label3.TextAlignment = UITextAlignment.Left;
            label3.Font          = UIFont.SystemFontOfSize(18);
            label3.Frame         = new CGRect(120, 0, 150, 50);

            layout.AddSubview(label3);
            layout.Hidden = true;
            AddSubview(layout);

            header = new UILabel();
            header.TextAlignment = UITextAlignment.Center;
            header.Text          = "Click on a shape to drill";
            header.Font          = UIFont.SystemFontOfSize(18);
            header.TextAlignment = UITextAlignment.Center;



            view.AddSubview(header);

            NSTimer.CreateScheduledTimer(TimeSpan.FromSeconds(0.3), delegate
            {
                maps.Frame = new CGRect(Frame.Location.X, 60, Frame.Size.Width - 6, Frame.Size.Height - 60);

                view.AddSubview(maps);
            });

            layer = new SFShapeFileLayer();

            layer.Uri               = (NSString)NSBundle.MainBundle.PathForResource("world-map", "shp");
            layer.ShapeIDPath       = (NSString)"country";
            layer.ShapeIDTableField = (NSString)"admin";
            layer.ShowMapItems      = true;
            layer.EnableSelection   = true;
            layer.DataSource        = GetDataSource();

            SFShapeSetting shapeSettings = new SFShapeSetting();

            shapeSettings.ColorValuePath = (NSString)"continent";
            SetColorMapping(shapeSettings);
            layer.ShapeSettings = shapeSettings;

            ObservableCollection <SFMapMarker> markers = new ObservableCollection <SFMapMarker>();

            LabelMarker marker1 = new LabelMarker();

            marker1.Name      = (NSString)"Asia";
            marker1.Latitude  = 63.34303378997662;
            marker1.Longitude = 102.07617561287645;
            markers.Add(marker1);

            LabelMarker marker2 = new LabelMarker();

            marker2.Name      = (NSString)"Australia";
            marker2.Latitude  = -25.74775493367931;
            marker2.Longitude = 136.80451417932431;
            markers.Add(marker2);

            LabelMarker marker3 = new LabelMarker();

            marker3.Name      = (NSString)"Africa";
            marker3.Latitude  = 19.025302093442327;
            marker3.Longitude = 15.157534554671087;
            markers.Add(marker3);

            LabelMarker marker4 = new LabelMarker();

            marker4.Name      = (NSString)"North America";
            marker4.Latitude  = 59.88893689676585;
            marker4.Longitude = -109.3359375;
            markers.Add(marker4);

            LabelMarker marker5 = new LabelMarker();

            marker5.Name      = (NSString)"Europe";
            marker5.Latitude  = 47.95121990866204;
            marker5.Longitude = 18.468749999999998;
            markers.Add(marker5);

            LabelMarker marker6 = new LabelMarker();

            marker6.Name      = (NSString)"South America";
            marker6.Latitude  = -6.64607562172573;
            marker6.Longitude = -55.54687499999999;
            markers.Add(marker6);

            layer.Markers = markers;

            SFShapeFileLayer layer1 = new SFShapeFileLayer();

            layer1.Uri               = (NSString)NSBundle.MainBundle.PathForResource("south-america", "shp");
            layer1.ShapeIDPath       = (NSString)"country";
            layer1.ShapeIDTableField = (NSString)"admin";

            SFShapeSetting shapeSettings1 = new SFShapeSetting();

            shapeSettings1.Fill  = UIColor.FromRGB(156, 51, 103);
            layer1.ShapeSettings = shapeSettings1;

            SFShapeFileLayer layer2 = new SFShapeFileLayer();

            layer2.Uri               = (NSString)NSBundle.MainBundle.PathForResource("north-america", "shp");
            layer2.ShapeIDPath       = (NSString)"country";
            layer2.ShapeIDTableField = (NSString)"admin";

            SFShapeSetting shapeSettings2 = new SFShapeSetting();

            shapeSettings2.Fill  = UIColor.FromRGB(193, 54, 100);
            layer2.ShapeSettings = shapeSettings2;

            SFShapeFileLayer layer3 = new SFShapeFileLayer();

            layer3.Uri               = (NSString)NSBundle.MainBundle.PathForResource("europe", "shp");
            layer3.ShapeIDPath       = (NSString)"country";
            layer3.ShapeIDTableField = (NSString)"admin";

            SFShapeSetting shapeSettings3 = new SFShapeSetting();

            shapeSettings3.Fill  = UIColor.FromRGB(98, 45, 108);
            layer3.ShapeSettings = shapeSettings3;

            SFShapeFileLayer layer4 = new SFShapeFileLayer();

            layer4.Uri               = (NSString)NSBundle.MainBundle.PathForResource("africa", "shp");
            layer4.ShapeIDPath       = (NSString)"country";
            layer4.ShapeIDTableField = (NSString)"admin";

            SFShapeSetting shapeSettings4 = new SFShapeSetting();

            shapeSettings4.Fill  = UIColor.FromRGB(128, 48, 106);
            layer4.ShapeSettings = shapeSettings4;

            SFShapeFileLayer layer5 = new SFShapeFileLayer();

            layer5.Uri               = (NSString)NSBundle.MainBundle.PathForResource("australia", "shp");
            layer5.ShapeIDPath       = (NSString)"country";
            layer5.ShapeIDTableField = (NSString)"admin";

            SFShapeSetting shapeSettings5 = new SFShapeSetting();

            shapeSettings5.Fill  = UIColor.FromRGB(42, 40, 112);
            layer5.ShapeSettings = shapeSettings5;

            SFShapeFileLayer layer6 = new SFShapeFileLayer();

            layer6.Uri               = (NSString)NSBundle.MainBundle.PathForResource("asia", "shp");
            layer6.ShapeIDPath       = (NSString)"country";
            layer6.ShapeIDTableField = (NSString)"admin";

            SFShapeSetting shapeSettings6 = new SFShapeSetting();

            shapeSettings6.Fill  = UIColor.FromRGB(70, 42, 109);
            layer6.ShapeSettings = shapeSettings6;

            maps.Layers.Add(layer);
            maps.Layers.Add(layer1);
            maps.Layers.Add(layer2);
            maps.Layers.Add(layer3);
            maps.Layers.Add(layer4);
            maps.Layers.Add(layer5);
            maps.Layers.Add(layer6);

            AddSubview(view);
            maps.Delegate = new MapsDrilldownDelegate(this);
        }
Example #15
0
        public Sublayer()
        {
            SFMap maps = new SFMap();

            view          = new UIView();
            view.Frame    = new CGRect(0, 0, 300, 400);
            busyindicator = new SFBusyIndicator();
            busyindicator.ViewBoxWidth  = 75;
            busyindicator.ViewBoxHeight = 75;
            busyindicator.Foreground    = UIColor.FromRGB(0x77, 0x97, 0x72); /*#779772*/
            busyindicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeSlicedCircle;
            view.AddSubview(busyindicator);
            label = new UILabel();
            label.TextAlignment = UITextAlignment.Center;
            label.Text          = "Samsung Semiconductor office locations in USA";
            label.Font          = UIFont.SystemFontOfSize(18);
            label.Frame         = new CGRect(0, 0, 400, 40);
            label.TextColor     = UIColor.Black;
            view.AddSubview(label);

            NSTimer.CreateScheduledTimer(TimeSpan.FromSeconds(0.3), delegate {
                maps.Frame = new CGRect(Frame.Location.X, 60, Frame.Size.Width - 6, Frame.Size.Height - 60);

                view.AddSubview(maps);
            });

            SFShapeFileLayer layer = new SFShapeFileLayer();

            layer.Uri               = (NSString)NSBundle.MainBundle.PathForResource("usa_state", "shp");
            layer.ShapeIDPath       = (NSString)"Name";
            layer.ShapeIDTableField = (NSString)"STATE_NAME";
            layer.ShowMapItems      = true;
            layer.DataSource        = GetDataSource();

            SFShapeSetting shapeSettings = new SFShapeSetting();

            shapeSettings.ValuePath       = (NSString)"Type";
            shapeSettings.Fill            = UIColor.FromRGB(229, 229, 229);
            shapeSettings.StrokeColor     = UIColor.FromRGB(208, 208, 208);
            shapeSettings.StrokeThickness = 2;
            layer.ShapeSettings           = shapeSettings;

            SFDataLabelSetting dataLabelSetting = new SFDataLabelSetting();

            dataLabelSetting.SmartLabelMode = IntersectAction.Trim;
            layer.DataLabelSettings         = dataLabelSetting;

            SFShapeFileLayer subLayer = new SFShapeFileLayer();

            subLayer.Uri = (NSString)NSBundle.MainBundle.PathForResource("Texas", "shp");

            SFMapMarker marker1 = new SFMapMarker();

            marker1.Latitude  = 32.870404;
            marker1.Longitude = -99.467014;
            subLayer.Markers.Add(marker1);

            SFShapeFileLayer subLayer1 = new SFShapeFileLayer();

            subLayer1.Uri = (NSString)NSBundle.MainBundle.PathForResource("California", "shp");

            SFMapMarker marker2 = new SFMapMarker();

            marker2.Latitude  = 38.778259;
            marker2.Longitude = -120.463228;
            subLayer1.Markers.Add(marker2);

            SFShapeSetting subshapeSettings = new SFShapeSetting();

            subshapeSettings.Fill            = UIColor.FromRGB(177, 216, 245);
            subshapeSettings.StrokeColor     = UIColor.FromRGB(141, 204, 244);
            subshapeSettings.StrokeThickness = 1;

            subLayer.ShapeSettings  = subshapeSettings;
            subLayer1.ShapeSettings = subshapeSettings;


            layer.Sublayers.Add(subLayer);
            layer.Sublayers.Add(subLayer1);
            maps.Layers.Add(layer);
            AddSubview(view);
            maps.Delegate = new MapsSublayerDelegate(this);
        }
Example #16
0
        public Sublayer()
        {
            maps       = new SFMap();
            view       = new UIView();
            view.Frame = new CGRect(0, 0, 300, 400);

            label = new UILabel();
            label.TextAlignment = UITextAlignment.Center;
            label.Text          = "Samsung Semiconductor office locations in USA";
            label.Font          = UIFont.SystemFontOfSize(18);
            label.Frame         = new CGRect(0, 0, 400, 40);
            label.TextColor     = UIColor.Black;
            view.AddSubview(label);

            SFShapeFileLayer layer = new SFShapeFileLayer();

            layer.Uri               = (NSString)NSBundle.MainBundle.PathForResource("usa_state", "shp");
            layer.ShapeIDPath       = (NSString)"Name";
            layer.ShapeIDTableField = (NSString)"STATE_NAME";
            layer.ShowMapItems      = true;
            layer.DataSource        = GetDataSource();

            SFShapeSetting shapeSettings = new SFShapeSetting();

            shapeSettings.ValuePath       = (NSString)"Type";
            shapeSettings.Fill            = UIColor.FromRGB(229, 229, 229);
            shapeSettings.StrokeColor     = UIColor.FromRGB(208, 208, 208);
            shapeSettings.StrokeThickness = 2;
            layer.ShapeSettings           = shapeSettings;

            SFDataLabelSetting dataLabelSetting = new SFDataLabelSetting();

            dataLabelSetting.SmartLabelMode = IntersectAction.Trim;
            layer.DataLabelSettings         = dataLabelSetting;

            SFShapeFileLayer subLayer = new SFShapeFileLayer();

            subLayer.Uri = (NSString)NSBundle.MainBundle.PathForResource("Texas", "shp");

            SFMapMarker marker1 = new SFMapMarker();

            marker1.Latitude  = 32.870404;
            marker1.Longitude = -98.467014;
            subLayer.Markers.Add(marker1);

            SFShapeFileLayer subLayer1 = new SFShapeFileLayer();

            subLayer1.Uri = (NSString)NSBundle.MainBundle.PathForResource("California", "shp");

            SFMapMarker marker2 = new SFMapMarker();

            marker2.Latitude  = 38.778259;
            marker2.Longitude = -120.463228;
            subLayer1.Markers.Add(marker2);

            SFShapeSetting subshapeSettings = new SFShapeSetting();

            subshapeSettings.Fill            = UIColor.FromRGB(177, 216, 245);
            subshapeSettings.StrokeColor     = UIColor.FromRGB(141, 204, 244);
            subshapeSettings.StrokeThickness = 1;

            SFMapMarkerSetting markerSetting = new SFMapMarkerSetting();

            markerSetting.IconColor = UIColor.FromRGB(0, 100, 0);

            subLayer.MarkerSettings  = markerSetting;
            subLayer1.MarkerSettings = markerSetting;

            subLayer.ShapeSettings  = subshapeSettings;
            subLayer1.ShapeSettings = subshapeSettings;


            layer.Sublayers.Add(subLayer);
            layer.Sublayers.Add(subLayer1);

            maps.Layers.Add(layer);
            AddSubview(view);
        }
Example #17
0
        public BubbleVisualization ()
        {
            
            SFMap maps = new SFMap ();
            view = new UIView ();
            view.Frame=new CGRect(0,0,300,400);
            busyindicator = new SfBusyIndicator();
            busyindicator.ViewBoxWidth=75;
            busyindicator.ViewBoxHeight=75;
            busyindicator.Foreground=  UIColor.FromRGB (0x77, 0x97, 0x72);  /*#779772*/
            busyindicator.AnimationType=SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeSlicedCircle;
            view.AddSubview (busyindicator);
            label = new UILabel ();
            label.TextAlignment = UITextAlignment.Center;
            label.Text = "Top 40 Population Countries With Bubbles";
			label.Font = UIFont.SystemFontOfSize (18);
			label.Frame=new  CGRect(0,0,400,40);
			label.TextColor = UIColor.Black;
			view.AddSubview (label);

			NSTimer.CreateScheduledTimer (TimeSpan.FromSeconds (0.3), delegate {
                if (isDisposed)
                    return;
				maps.Frame = new CGRect(Frame.Location.X,60,Frame.Size.Width-6,Frame.Size.Height-60);

				view.AddSubview (maps);
			});

			SFShapeFileLayer layer = new SFShapeFileLayer ();
            layer.Uri = (NSString)NSBundle.MainBundle.PathForResource("world1", "shp");
            layer.ShapeIDPath = (NSString)"Country";
            layer.ShapeIDTableField = (NSString)"NAME";
            layer.ShowMapItems = true;
			layer.DataSource = GetDataSource();

			SFShapeSetting shapeSettings = new SFShapeSetting ();
            shapeSettings.Fill = UIColor.LightGray;
			layer.ShapeSettings = shapeSettings;
			
            SFBubbleMarkerSetting marker = new SFBubbleMarkerSetting();
            marker.ValuePath = (NSString)"Percent";
            marker.ColorValuePath = (NSString)"Percent";

            BubbleCustomTooltipSetting tooltipSetting = new BubbleCustomTooltipSetting();
            tooltipSetting.ShowTooltip = true;
            marker.TooltipSettings = tooltipSetting;

            ObservableCollection<SFMapColorMapping> colorMappings = new ObservableCollection<SFMapColorMapping>();

            SFRangeColorMapping rangeColorMapping1 = new SFRangeColorMapping();
            rangeColorMapping1.To = 20;
            rangeColorMapping1.From = 4;
            rangeColorMapping1.LegendLabel = (NSString)"Above 4%";
            rangeColorMapping1.Color = UIColor.FromRGB(46, 118, 159);
            colorMappings.Add(rangeColorMapping1);

            SFRangeColorMapping rangeColorMapping2 = new SFRangeColorMapping();
            rangeColorMapping2.To = 4;
            rangeColorMapping2.From = 2;
            rangeColorMapping2.LegendLabel = (NSString)"4% - 2%";
            rangeColorMapping2.Color = UIColor.FromRGB(216, 68, 68);
            colorMappings.Add(rangeColorMapping2);

            SFRangeColorMapping rangeColorMapping3 = new SFRangeColorMapping();
            rangeColorMapping3.To = 2;
            rangeColorMapping3.From = 1;
            rangeColorMapping3.LegendLabel = (NSString)"2% - 1%";
            rangeColorMapping3.Color = UIColor.FromRGB(129, 111, 40);
            colorMappings.Add(rangeColorMapping3);

            SFRangeColorMapping rangeColorMapping4 = new SFRangeColorMapping();
            rangeColorMapping4.To = 1;
            rangeColorMapping4.From = 0;
            rangeColorMapping4.LegendLabel = (NSString)"Below 1%";
            rangeColorMapping4.Color = UIColor.FromRGB(127, 56, 160);
            colorMappings.Add(rangeColorMapping4);

            marker.ColorMappings = colorMappings;
           
			layer.BubbleMarkerSetting = marker;

            SFMapLegendSettings mapLegendSettings = new SFMapLegendSettings();
            mapLegendSettings.ShowLegend = true;
            mapLegendSettings.LegendType = LegendType.Bubbles;
           
            layer.LegendSettings = mapLegendSettings;

			maps.Layers.Add (layer);
			

            label2 = new UILabel();
            label2.TextAlignment = UITextAlignment.Center;
            var text1 = new NSString("en.wikipedia.org");
            label2.Text = text1;
            label2.Font = UIFont.SystemFontOfSize(12);
            var stringAtribute = new NSDictionary(UIStringAttributeKey.Font, label2.Font,
                                                  UIStringAttributeKey.ForegroundColor, UIColor.FromRGB(0, 191, 255));
            UIStringAttributes strAtr1 = new UIStringAttributes(stringAtribute);
            label2Size = text1.GetSizeUsingAttributes(strAtr1);
            label2.TextColor = UIColor.FromRGB(0, 191, 255);
            label2.Frame = new CGRect(Frame.Size.Width, Frame.Size.Height - 20, 100, 20);
            label2.UserInteractionEnabled = true;
            UITapGestureRecognizer tapGesture = new UITapGestureRecognizer();
            tapGesture.ShouldReceiveTouch += TapGesture_ShouldReceiveTouch;
            label2.AddGestureRecognizer(tapGesture);

            view.AddSubview(label2);

            AddSubview (view);
            maps.Delegate = new MapsBubbleDelegate (this);

        }