public override Android.Views.View GetSampleContent(Android.Content.Context context) { currentToast = new Toast(context); sampleContext = context; LinearLayout layout = new LinearLayout(context); layout.Orientation = Orientation.Vertical; TextView textView = new TextView(context); textView.TextSize = 16; textView.SetPadding(10, 20, 0, 0); textView.SetHeight(90); handler = new Handler(); textView.Text = "Top Population Countries"; layout.AddView(textView); textView.Gravity = Android.Views.GravityFlags.Top; SfMaps maps = new SfMaps(context); ShapeFileLayer layer = new ShapeFileLayer(); layer.Uri = "world1.shp"; SfBusyIndicator sfBusyIndicator = new SfBusyIndicator(context); sfBusyIndicator.IsBusy = true; sfBusyIndicator.AnimationType = AnimationTypes.SlicedCircle; sfBusyIndicator.ViewBoxWidth = 50; sfBusyIndicator.ViewBoxHeight = 50; sfBusyIndicator.TextColor = Color.ParseColor("#779772"); layout.AddView(sfBusyIndicator); Java.Lang.Runnable run = new Java.Lang.Runnable(() => { layout.RemoveView(sfBusyIndicator); layout.AddView(maps); }); handler.PostDelayed(run, 100); layer.MarkerSelected += Layer_MarkerSelected; PopulationMarker usa = new PopulationMarker(context); usa.Latitude = 45.8833; usa.Longitude = -77.0167; usa.Name = "United States"; usa.Population = "321,174,000"; layer.Markers.Add(usa); PopulationMarker brazil = new PopulationMarker(context); brazil.Latitude = -7.307985; brazil.Longitude = -48.387724; brazil.Name = "Brazil"; brazil.Population = "204,436,000"; layer.Markers.Add(brazil); PopulationMarker india = new PopulationMarker(context); india.Latitude = 24.593683; india.Longitude = 78.962883; india.Name = "India"; india.Population = "1,272,470,000"; layer.Markers.Add(india); PopulationMarker china = new PopulationMarker(context); china.Latitude = 35.861660; china.Longitude = 104.195396; china.Name = "China"; china.Population = "1,370,320,000"; layer.Markers.Add(china); PopulationMarker indonesia = new PopulationMarker(context); indonesia.Latitude = -0.789275; indonesia.Longitude = 113.921326; indonesia.Name = "Indonesia"; indonesia.Population = "255,461,700"; layer.Markers.Add(indonesia); MarkerSetting markerSetting = new MarkerSetting(); markerSetting.ImageSource = "pin.png"; markerSetting.MarkerIcon = MarkerIcon.Image; markerSetting.IconSize = 15; layer.MarkerSetting = markerSetting; maps.Layers.Add(layer); return(layout); }
public override Android.Views.View GetSampleContent(Android.Content.Context context) { handler = new Handler(); LinearLayout layout = new LinearLayout(context); layout.Orientation = Orientation.Vertical; TextView textView = new TextView(context); textView.TextSize = 16; textView.SetPadding(10, 20, 0, 0); textView.SetHeight(90); textView.Text = "Samsung Semiconductor office location in USA"; layout.AddView(textView); textView.Gravity = Android.Views.GravityFlags.Top; maps = new SfMaps(context); ShapeFileLayer layer = new ShapeFileLayer(); layer.ShowItems = true; layer.Uri = "usa_state.shp"; layer.DataSource = GetDataSource(); layer.ShapeIdPath = "Name"; layer.ShapeIdTableField = "STATE_NAME"; layer.DataLabelSettings = new DataLabelSetting() { TextColor = Color.Black }; layer.ShapeSettings = new ShapeSetting(); layer.ShapeSettings.ShapeValuePath = "Type"; layer.ShapeSettings.ShapeFill = Color.ParseColor("#E5E5E5"); layer.ShapeSettings.ShapeStroke = Color.ParseColor("#D0D0D0"); layer.ShapeSettings.ShapeStrokeThickess = 2; layer.DataLabelSettings.IntersectionAction = IntersectAction.Trim; SubShapeFileLayer subLayer = new SubShapeFileLayer(); subLayer.Uri = "Texas.shp"; subLayer.ShapeSettings.ShapeFill = Color.ParseColor("#B1D8F5"); subLayer.ShapeSettings.ShapeStroke = Color.ParseColor("#8DCCF4"); subLayer.ShapeSettings.ShapeStrokeThickess = 1; MapMarker mapMarker = new MapMarker(); mapMarker.Latitude = 30.267153; mapMarker.Longitude = -97.7430608; subLayer.Markers.Add(mapMarker); MarkerSetting markerSetting = new MarkerSetting(); markerSetting.MarkerIconColor = Color.DarkGreen; markerSetting.IconSize = 7; subLayer.MarkerSetting = markerSetting; SubShapeFileLayer subLayer1 = new SubShapeFileLayer(); subLayer1.Uri = "California.shp"; subLayer1.ShapeSettings.ShapeFill = Color.ParseColor("#B1D8F5"); subLayer1.ShapeSettings.ShapeStroke = Color.ParseColor("#8DCCF4"); subLayer1.ShapeSettings.ShapeStrokeThickess = 1; MapMarker mapMarker1 = new MapMarker(); mapMarker1.Latitude = 37.3382082; mapMarker1.Longitude = -121.8863286; subLayer1.Markers.Add(mapMarker1); MarkerSetting markerSetting1 = new MarkerSetting(); markerSetting1.MarkerIconColor = Color.DarkGreen; markerSetting1.IconSize = 7; subLayer1.MarkerSetting = markerSetting1; layer.SubShapeFileLayers.Add(subLayer); layer.SubShapeFileLayers.Add(subLayer1); maps.Layers.Add(layer); SfBusyIndicator sfBusyIndicator = new SfBusyIndicator(context); sfBusyIndicator.IsBusy = true; sfBusyIndicator.AnimationType = AnimationTypes.SlicedCircle; sfBusyIndicator.ViewBoxWidth = 50; sfBusyIndicator.ViewBoxHeight = 50; sfBusyIndicator.TextColor = Color.ParseColor("#779772"); layout.AddView(sfBusyIndicator); Java.Lang.Runnable run = new Java.Lang.Runnable(() => { layout.RemoveView(sfBusyIndicator); layout.AddView(maps); }); handler.PostDelayed(run, 100); return(layout); }
public override Android.Views.View GetSampleContent(Android.Content.Context context) { handler = new Handler(); frameLayout = new FrameLayout(context); frameLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); LinearLayout linearLayout = new LinearLayout(context); linearLayout.Orientation = Orientation.Vertical; linearLayout.LayoutParameters = new Android.Views.ViewGroup.LayoutParams(Android.Views.ViewGroup.LayoutParams.MatchParent, Android.Views.ViewGroup.LayoutParams.MatchParent); sampleContext = context; LinearLayout layout = new LinearLayout(context); layout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); layout.Orientation = Orientation.Horizontal; layout.SetHorizontalGravity(GravityFlags.Center); TextView textView = new TextView(context); textView.TextSize = 16; textView.SetPadding(2, 2, 2, 2); textView.SetHeight(90); textView.Gravity = Android.Views.GravityFlags.Top; textView.Text = "Samsung Semiconductor office location in USA"; layout.AddView(textView); frameLayout.AddView(layout); maps = new SfMaps(context); maps.LayoutParameters = new Android.Views.ViewGroup.LayoutParams(Android.Views.ViewGroup.LayoutParams.MatchParent, Android.Views.ViewGroup.LayoutParams.MatchParent); ShapeFileLayer layer = new ShapeFileLayer(); layer.ShowItems = true; layer.Uri = "usa_state.shp"; layer.DataSource = GetDataSource(); layer.ShapeIdPath = "Name"; layer.ShapeIdTableField = "STATE_NAME"; layer.DataLabelSettings = new DataLabelSetting() { TextColor = Color.Black }; layer.ShapeSettings = new ShapeSetting(); layer.ShapeSettings.ShapeValuePath = "Type"; layer.ShapeSettings.ShapeFill = Color.ParseColor("#E5E5E5"); layer.ShapeSettings.ShapeStroke = Color.ParseColor("#D0D0D0"); layer.ShapeSettings.ShapeStrokeThickess = 2; layer.DataLabelSettings.IntersectionAction = IntersectAction.Trim; SubShapeFileLayer subLayer = new SubShapeFileLayer(); subLayer.Uri = "Texas.shp"; subLayer.ShapeSettings.ShapeFill = Color.ParseColor("#B1D8F5"); subLayer.ShapeSettings.ShapeStroke = Color.ParseColor("#8DCCF4"); subLayer.ShapeSettings.ShapeStrokeThickess = 1; MapMarker mapMarker = new MapMarker(); mapMarker.Latitude = 30.267153; mapMarker.Longitude = -97.7430608; subLayer.Markers.Add(mapMarker); MarkerSetting markerSetting = new MarkerSetting(); markerSetting.MarkerIconColor = Color.DarkGreen; markerSetting.IconSize = 7; subLayer.MarkerSetting = markerSetting; SubShapeFileLayer subLayer1 = new SubShapeFileLayer(); subLayer1.Uri = "California.shp"; subLayer1.ShapeSettings.ShapeFill = Color.ParseColor("#B1D8F5"); subLayer1.ShapeSettings.ShapeStroke = Color.ParseColor("#8DCCF4"); subLayer1.ShapeSettings.ShapeStrokeThickess = 1; MapMarker mapMarker1 = new MapMarker(); mapMarker1.Latitude = 37.3382082; mapMarker1.Longitude = -121.8863286; subLayer1.Markers.Add(mapMarker1); MarkerSetting markerSetting1 = new MarkerSetting(); markerSetting1.MarkerIconColor = Color.DarkGreen; markerSetting1.IconSize = 7; subLayer1.MarkerSetting = markerSetting1; layer.SubShapeFileLayers.Add(subLayer); layer.SubShapeFileLayers.Add(subLayer1); maps.Layers.Add(layer); frameLayout.AddView(maps); frameLayout.SetClipChildren(false); LinearLayout linear = new LinearLayout(context); linear.Orientation = Orientation.Horizontal; linear.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); linear.SetHorizontalGravity(GravityFlags.End); linear.SetVerticalGravity(GravityFlags.Bottom); TextView textView1 = new TextView(context); textView1.Text = "Source:"; textView1.SetBackgroundColor(Color.White); textView1.SetTextColor(Color.Black); textView1.SetPadding(2, 2, 2, 2); linear.AddView(textView1); TextView textView2 = new TextView(context); textView2.Text = "www.samsung.com"; textView2.SetTextColor(Color.DeepSkyBlue); textView2.SetPadding(0, 2, 3, 2); textView2.SetBackgroundColor(Color.White); textView2.Clickable = true; textView2.Click += TextView2_Click; linear.AddView(textView2); frameLayout.AddView(linear); SfBusyIndicator sfBusyIndicator = new SfBusyIndicator(context); sfBusyIndicator.IsBusy = true; sfBusyIndicator.AnimationType = AnimationTypes.SlicedCircle; sfBusyIndicator.ViewBoxWidth = 50; sfBusyIndicator.ViewBoxHeight = 50; sfBusyIndicator.TextColor = Color.ParseColor("#779772"); linearLayout.AddView(sfBusyIndicator); Java.Lang.Runnable run = new Java.Lang.Runnable(() => { linearLayout.RemoveView(sfBusyIndicator); linearLayout.AddView(frameLayout); }); handler.PostDelayed(run, 100); return(linearLayout); }