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; }
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); }
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); }
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); }