Esempio n. 1
0
        public ColorMapping()
        {
            maps                = new SFMap();
            view                = new UIView();
            view.Frame          = new CGRect(0, 0, 300, 400);
            markerView          = new UIView();
            label               = new UILabel();
            label.TextAlignment = UITextAlignment.Center;
            label.Text          = "Primary Agricultural Activity of USA";
            label.Font          = UIFont.SystemFontOfSize(18);
            label.Frame         = new  CGRect(0, 0, 300, 40);
            label.TextColor     = UIColor.Black;
            view.AddSubview(label);



            layer            = new SFShapeFileLayer();
            layer.Uri        = (NSString)NSBundle.MainBundle.PathForResource("usa_state", "shp");
            layer.DataSource = GetDataSource();
            SetColorMapping(layer.ShapeSettings);
            layer.ShapeSettings.ColorValuePath = (NSString)"Type";
            layer.ShapeSettings.StrokeColor    = UIColor.White;
            layer.LegendSettings            = new SFMapLegendSettings();
            layer.LegendSettings.Position   = new CGPoint(50, 10);
            layer.LegendSettings.ShowLegend = true;
            layer.EnableSelection           = true;
            layer.ShapeSelectionChanged    += Layer_ShapeSelectionChanged;
            maps.Layers.Add(layer);
            AddSubview(view);
        }
Esempio n. 2
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);
        }
Esempio n. 3
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;
        }
Esempio n. 5
0
        public ColorMapping()
        {
            SFMap maps = new SFMap();

            view          = new UIView();
            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(0, 0, Frame.Size.Width, Frame.Size.Height);

                view.AddSubview(maps);
            });
            view.Frame          = new CGRect(0, 0, 300, 400);
            label               = new UILabel();
            label.TextAlignment = UITextAlignment.Center;
            label.Text          = "Primary Agricultural Activity of USA";
            label.Font          = UIFont.SystemFontOfSize(18);
            label.Frame         = new  CGRect(0, 0, 300, 40);
            label.TextColor     = UIColor.Black;
            view.AddSubview(label);

            layer            = new SFShapeFileLayer();
            layer.Uri        = (NSString)NSBundle.MainBundle.PathForResource("usa_state", "shp");
            layer.DataSource = GetDataSource();
            SetColorMapping(layer.ShapeSettings);
            layer.ShapeSettings.ColorValuePath = (NSString)"Type";
            layer.ShapeSettings.StrokeColor    = UIColor.White;
            layer.LegendSettings            = new SFMapLegendSettings();
            layer.LegendSettings.Position   = new CGPoint(50, 10);
            layer.LegendSettings.ShowLegend = true;
            maps.Layers.Add(layer);
            maps.Delegate = new MapsColorMappingDelegate(this);
            AddSubview(view);

            ColorMappingTooltipSetting tooltipSetting = new ColorMappingTooltipSetting();

            tooltipSetting.ShowTooltip = true;
            layer.TooltipSettings      = tooltipSetting;
        }
		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 ColorMapping ()
		{
			SFMap	maps = new SFMap ();
			view = new UIView ();
			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 {
				maps.Frame = new CGRect(Frame.Location.X,60,Frame.Size.Width-6,Frame.Size.Height-60);

				view.AddSubview (maps);
			});
			view.Frame=new CGRect(0,0,300,400);
			markerView = new UIView ();
			label = new UILabel ();
			label.TextAlignment = UITextAlignment.Center;
			label.Text = "Primary Agricultural Activity of USA";
			label.Font = UIFont.SystemFontOfSize (18);
			label.Frame=new  CGRect(0,0,300,40);
			label.TextColor = UIColor.Black;
			view.AddSubview (label);



			layer = new SFShapeFileLayer();
			layer.Uri = (NSString)NSBundle.MainBundle.PathForResource ("usa_state", "shp");
			layer.DataSource = GetDataSource ();
			SetColorMapping(layer.ShapeSettings);
			layer.ShapeSettings.ColorValuePath =(NSString)"Type";
			layer.ShapeSettings.StrokeColor = UIColor.White;
			layer.LegendSettings = new SFMapLegendSettings ();
			layer.LegendSettings.Position = new CGPoint (5, 75);
			layer.LegendSettings.ShowLegend = true;
			layer.EnableSelection = true;
			maps.Layers.Add (layer);
			AddSubview (view);
			maps.Delegate = new MapsColorMappingDelegate (this);

			this.control =this;
		}
Esempio n. 8
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;
        }
 public MapsCustomDelegate(TicketBooking sample, SFShapeFileLayer layer)
 {
     mapping      = sample;
     mappingLayer = layer;
 }
Esempio n. 10
0
		public DataMarkers () 
		{

			view = new UIView ();
			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 {
				maps.Frame = new CGRect(Frame.Location.X,60,Frame.Size.Width-6,Frame.Size.Height-60);

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

			maps =new SFMap ();

			SFShapeFileLayer layer = new SFShapeFileLayer ();
			layer.Uri = (NSString)NSBundle.MainBundle.PathForResource ("world1", "shp");
			PopulationMarker usa= new PopulationMarker();
			usa.Latitude =38.8833;
			usa.Name ="United States";
			usa.Longitude=-77.0167;
			usa.Population ="321,174,000";
			layer.Markers = new NSMutableArray ();
			layer.Markers.Add(usa);


			PopulationMarker brazil= new PopulationMarker();
			brazil.Latitude=-15.7833;
			brazil.Longitude=-47.8667;
			brazil.Name ="Brazil";
			brazil.Population= "204,436,000";
			layer.Markers.Add(brazil);


			PopulationMarker india= new PopulationMarker();
			india.Latitude=21.0000;
			india.Longitude=78.0000;
			india.Name ="India";
			india.Population ="1,272,470,000";
			layer.Markers.Add(india);


			PopulationMarker china= new PopulationMarker();
			china.Latitude=35.0000;
			china.Longitude=103.0000;
			china.Name ="China";
			china.Population = "1,370,320,000";
			layer.Markers.Add(china);



			PopulationMarker indonesia= new PopulationMarker();
			indonesia.Latitude=-6.1750;
			indonesia.Longitude=106.8283;
			indonesia.Name ="Indonesia";
			indonesia.Population="255,461,700";
			layer.Markers.Add(indonesia);
			maps.Delegate = new MapsDelegate (this);

			maps.Layers.Add (layer);

			AddSubview (view);
			control = this;


		}
Esempio n. 11
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);

        }
Esempio n. 12
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);
        }
        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);
        }
Esempio n. 14
0
        public DataMarkers()
        {
            view = new UIView();

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

            maps = new SFMap();

            SFShapeFileLayer layer = new SFShapeFileLayer();

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

            usa.Latitude   = 38.8833;
            usa.Name       = "United States";
            usa.Longitude  = -77.0167;
            usa.Population = "321,174,000";
            layer.Markers.Add(usa);


            PopulationMarker brazil = new PopulationMarker();

            brazil.Latitude   = -15.7833;
            brazil.Longitude  = -47.8667;
            brazil.Name       = "Brazil";
            brazil.Population = "204,436,000";
            layer.Markers.Add(brazil);


            PopulationMarker india = new PopulationMarker();

            india.Latitude   = 21.0000;
            india.Longitude  = 78.0000;
            india.Name       = "India";
            india.Population = "1,272,470,000";
            layer.Markers.Add(india);


            PopulationMarker china = new PopulationMarker();

            china.Latitude   = 35.0000;
            china.Longitude  = 103.0000;
            china.Name       = "China";
            china.Population = "1,370,320,000";
            layer.Markers.Add(china);



            PopulationMarker indonesia = new PopulationMarker();

            indonesia.Latitude   = -6.1750;
            indonesia.Longitude  = 106.8283;
            indonesia.Name       = "Indonesia";
            indonesia.Population = "255,461,700";
            layer.Markers.Add(indonesia);
            maps.Delegate = new MapsDelegate(this);

            maps.Layers.Add(layer);

            AddSubview(view);
        }
        public TicketBooking()
        {
            maps         = new SFMap();
            view         = new UIView();
            container    = new UIView();
            subcontainer = new UIView();
            LayoutA      = new UIView();
            LayoutB      = new UIView();
            LayoutC      = new UIView();
            LayoutD      = new UIView();

            button1    = new UIButton();
            button2    = new UIButton();
            button3    = new UIButton();
            button4    = new UIButton();
            label1     = new UILabel();
            label2     = new UILabel();
            label3     = new UILabel();
            label4     = new UILabel();
            label5     = new UILabel();
            text1      = new UITextView();
            scrollView = new UIScrollView();


            view.BackgroundColor = UIColor.White;

            NSTimer.CreateScheduledTimer(TimeSpan.FromSeconds(0.3), delegate
            {
                container.AddSubview(maps);
            });



            view.Frame          = new CGRect(0, 0, 300, 400);
            label               = new UILabel();
            label.TextAlignment = UITextAlignment.Center;
            label.Text          = "Ticketing System";
            label.Font          = UIFont.SystemFontOfSize(18);
            label.Frame         = new CGRect(0, 0, 300, 40);
            label.TextColor     = UIColor.Black;
            view.AddSubview(label);

            //container.BackgroundColor = UIColor.Red;
            container.Layer.CornerRadius = 5;
            container.Layer.BorderWidth  = 3;
            container.Layer.BorderColor  = UIColor.Gray.CGColor;


            layer = new SFShapeFileLayer();
            layer.ShapeSettings.SelectedShapeColor = UIColor.FromRGB(98, 170, 95);
            layer.Uri             = (NSString)NSBundle.MainBundle.PathForResource("Custom", "shp");
            layer.EnableSelection = true;
            layer.ShapeSettings.SelectedShapeStrokeThickness = 0;
            layer.DataSource = GetDataSource();

            SetColorMapping(layer.ShapeSettings);
            layer.GeometryType  = SFGeometryType.SFGeometryTypePoints;
            layer.SelectionMode = SFSelectionMode.SFSelectionModeMultiple;
            layer.ShapeIDPath   = (NSString)"SeatNumber";
            layer.ShapeSettings.ColorValuePath = (NSString)"SeatNumber";

            layer.ShapeSettings.valuePath = (NSString)"SeatNumber";
            layer.ShapeSettings.Fill      = UIColor.Gray;
            layer.ShapeIDTableField       = (NSString)"seatno";


            maps.Delegate = new MapsCustomDelegate(this, layer);
            maps.Layers.Add(layer);
            container.Add(maps);

            view.Add(container);



            subcontainer.BackgroundColor    = UIColor.White;
            subcontainer.Layer.CornerRadius = 5;

            //LayoutA.BackgroundColor = UIColor.Green;
            LayoutA.Layer.CornerRadius = 5;
            button1.BackgroundColor    = UIColor.Gray;
            button1.Layer.CornerRadius = 5;


            LayoutA.Add(button1);
            label1.Text      = "Available";
            label1.Font      = UIFont.SystemFontOfSize(12);
            label1.TextColor = UIColor.Black;

            LayoutA.Add(label1);
            subcontainer.Add(LayoutA);



            //LayoutB.BackgroundColor = UIColor.Purple;
            LayoutB.Layer.CornerRadius = 5;
            button2.BackgroundColor    = UIColor.FromRGB(98, 170, 95);
            button2.Layer.CornerRadius = 5;
            LayoutB.Add(button2);
            label2.Text      = "Selected";
            label2.TextColor = UIColor.Black;
            label2.Font      = UIFont.SystemFontOfSize(12);
            LayoutB.Add(label2);
            subcontainer.Add(LayoutB);



            LayoutC.Layer.CornerRadius = 5;
            button3.BackgroundColor    = UIColor.FromRGB(255, 165, 0);
            button3.Layer.CornerRadius = 5;
            LayoutC.Add(button3);
            label3.Text      = "Booked";
            label3.TextColor = UIColor.Black;
            label3.Font      = UIFont.SystemFontOfSize(12);
            LayoutC.Add(label3);
            subcontainer.Add(LayoutC);


            LayoutD.BackgroundColor    = UIColor.Gray;
            LayoutD.Layer.CornerRadius = 5;
            subcontainer.Add(LayoutD);

            label4.Text          = "Seats Selected";
            label4.TextAlignment = UITextAlignment.Center;
            label4.TextColor     = UIColor.Blue;
            label4.Font          = UIFont.SystemFontOfSize(12);
            subcontainer.Add(label4);

            label5.Text          = "";
            label5.TextAlignment = UITextAlignment.Left;
            label5.TextColor     = UIColor.Black;
            label5.Font          = UIFont.SystemFontOfSize(20);
            subcontainer.Add(label5);



            text1.Text = "";
            //text1.BackgroundColor = UIColor.Blue;
            text1.TextAlignment = UITextAlignment.Center;
            text1.TextColor     = UIColor.Black;
            text1.Font          = UIFont.SystemFontOfSize(12);

            subcontainer.Add(text1);



            button4.BackgroundColor    = UIColor.Clear;
            button4.Enabled            = false;
            button4.Alpha              = (float)0.5;
            button4.Layer.CornerRadius = 5;
            button4.Layer.BorderColor  = UIColor.Gray.CGColor;
            button4.Layer.BorderWidth  = 2;
            button4.SetTitle("Clear Selection", UIControlState.Normal);
            button4.SetTitleColor(UIColor.Red, UIControlState.Normal);
            button4.TouchDown += (sender, e) => {
                layer.SelectedItems = new NSMutableArray();
                button4.Enabled     = false;
                button4.Alpha       = (float)0.5;
                label5.Text         = " ";
                text1.Text          = " ";
            };
            subcontainer.Add(button4);


            view.Add(subcontainer);



            AddSubview(view);
        }
Esempio n. 16
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);
        }
Esempio n. 17
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);
        }
Esempio n. 18
0
        public DataMarkers()
        {
            view          = new UIView();
            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);
            });
            view.Frame          = new CGRect(0, 0, 300, 400);
            markerView          = new UIView();
            label               = new UILabel();
            label.TextAlignment = UITextAlignment.Center;
            label.Text          = "Top Population Countries";
            label.Font          = UIFont.SystemFontOfSize(18);
            label.Frame         = new  CGRect(0, 0, 300, 40);
            label.TextColor     = UIColor.Black;
            view.AddSubview(label);

            maps = new SFMap();

            SFShapeFileLayer layer = new SFShapeFileLayer();

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

            usa.Latitude   = 38.8833;
            usa.Name       = "United States";
            usa.Longitude  = -77.0167;
            usa.Population = "321,174,000";
            layer.Markers.Add(usa);


            PopulationMarker brazil = new PopulationMarker();

            brazil.Latitude   = -15.7833;
            brazil.Longitude  = -47.8667;
            brazil.Name       = "Brazil";
            brazil.Population = "204,436,000";
            layer.Markers.Add(brazil);


            PopulationMarker india = new PopulationMarker();

            india.Latitude   = 21.0000;
            india.Longitude  = 78.0000;
            india.Name       = "India";
            india.Population = "1,272,470,000";
            layer.Markers.Add(india);


            PopulationMarker china = new PopulationMarker();

            china.Latitude   = 35.0000;
            china.Longitude  = 103.0000;
            china.Name       = "China";
            china.Population = "1,370,320,000";
            layer.Markers.Add(china);



            PopulationMarker indonesia = new PopulationMarker();

            indonesia.Latitude   = -6.1750;
            indonesia.Longitude  = 106.8283;
            indonesia.Name       = "Indonesia";
            indonesia.Population = "255,461,700";
            layer.Markers.Add(indonesia);
            maps.Delegate = new MapsDelegate(this);

            maps.Layers.Add(layer);

            AddSubview(view);
        }
Esempio n. 19
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);
        }