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 = "Rivers in Australia"; layout.AddView(textView); textView.Gravity = Android.Views.GravityFlags.Top; maps = new SfMaps(context); ShapeFileLayer layer = new ShapeFileLayer(); layer.Uri = "australia.shp"; layer.ShapeSettings.ShapeFill = Color.ParseColor("#ACF9F7"); layer.ShapeSettings.ShapeStrokeThickess = 1; maps.Layers.Add(layer); SubShapeFileLayer subLayer = new SubShapeFileLayer(); subLayer.Uri = "river.shp"; subLayer.ShapeSettings.ShapeFill = Color.ParseColor("#00A8CC"); subLayer.ShapeSettings.ShapeStrokeThickess = 2; layer.SubShapeFileLayers.Add(subLayer); 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); }
private void Form1_Load(object sender, EventArgs e) { this.MetroColor = Color.White; this.mapsControl1.Dock = DockStyle.Fill; this.mapsControl1.Margin = new Padding(0, 0, 4, 0); this.mapsControl1.MapBackgroundBrush = new SolidBrush(Color.White); this.mapsControl1.MapItemsShape = Syncfusion.Windows.Forms.Maps.MapItemShapes.None; this.mapsControl1.MapItemStroke = new SolidBrush(Color.Black); #region data MapViewModel viewmodel = new MapViewModel(); #endregion ShapeFileLayer shapeLayer = new ShapeFileLayer(); shapeLayer.ShapeSetting.FillSetting.AutoFillColors = false; shapeLayer.Uri = "states.shp"; shapeLayer.ShapeSetting.ShapeFill = "#E5E5E5"; shapeLayer.ShapeSetting.ShapeStrokeThickness = 0.5; shapeLayer.ShapeSetting.ShapeStroke = "#C1C1C1"; #region Sub-Layer(Sublayer) SubShapeFileLayer layer1 = new SubShapeFileLayer(); layer1.Uri = "landslide.shp"; layer1.ShapeSetting.ShapeFill = "#8DCEFF"; layer1.ShapeSetting.ShapeStrokeThickness = 0.5; layer1.ShapeSetting.ShapeStroke = "#2F8CEA"; shapeLayer.SubShapeFileLayers.Add(layer1); #endregion this.mapsControl1.Layers.Add(shapeLayer); }
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); }
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); }
private void Form1_Load(object sender, EventArgs e) { this.MetroColor = Color.White; this.mapsControl1.Dock = DockStyle.Fill; this.mapsControl1.MapItemDrawing += mapsControl1_MapItemDrawing; this.mapsControl1.Margin = new Padding(0, 0, 4, 0); this.mapsControl1.MapBackgroundBrush = new SolidBrush(Color.White); this.mapsControl1.MapItemsShape = Syncfusion.Windows.Forms.Maps.MapItemShapes.None; this.mapsControl1.MapItemStroke = new SolidBrush(Color.Black); #region data MapViewModel viewmodel = new MapViewModel(); #endregion ShapeFileLayer shapeLayer = new ShapeFileLayer(); shapeLayer.ShapeSetting.FillSetting.AutoFillColors = false; shapeLayer.ShowMapItem = true; shapeLayer.Uri = "continent.shp"; shapeLayer.ItemSource = viewmodel.MuliLayerList; shapeLayer.ShapeIDPath = "NAME"; shapeLayer.ShapeIDTableField = "Continent"; shapeLayer.ShapeSetting.ShapeValuePath = "Weather"; shapeLayer.ShapeSetting.ShapeColorValuePath = "Weather"; shapeLayer.ShapeSetting.ShapeFill = "#E5E5E5"; shapeLayer.ShapeSetting.ShapeStrokeThickness = 0.5; shapeLayer.ShapeSetting.ShapeStroke = "#C1C1C1"; shapeLayer.BubbleSetting.AutoFillColors = false; shapeLayer.BubbleSetting.MaxSize = 60; shapeLayer.BubbleSetting.MinSize = 30; shapeLayer.BubbleSetting.ValuePath = "Weather"; shapeLayer.BubbleSetting.ColorValuePath = "Weather"; shapeLayer.BubbleSetting.ColorMappings = new System.Collections.ObjectModel.ObservableCollection <ColorMapping>(); shapeLayer.BubbleSetting.ColorMappings.Add(new RangeColorMapping { From = 0, To = 30, Color = System.Drawing.Color.FromArgb(0x8C, 0x5F, 0xD3) }); shapeLayer.BubbleSetting.ColorMappings.Add(new RangeColorMapping { From = 45, To = 55, Color = System.Drawing.Color.FromArgb(0xEF, 0x6A, 0xB3) }); shapeLayer.BubbleSetting.ColorMappings.Add(new RangeColorMapping { From = 30, To = 40, Color = System.Drawing.Color.FromArgb(0x8A, 0xC6, 0x3C) }); shapeLayer.BubbleSetting.ColorMappings.Add(new RangeColorMapping { From = 40, To = 45, Color = System.Drawing.Color.FromArgb(0x8A, 0xC6, 0x3C) }); #region Multi-Layer(Sublayer) SubShapeFileLayer layer1 = new SubShapeFileLayer(); layer1.Uri = "Africa.shp"; layer1.ItemSource = viewmodel.AfricaList; layer1.ShapeIDPath = "NAME"; layer1.ShapeIDTableField = "Country"; layer1.ShapeSetting.ShapeValuePath = "Weather"; layer1.ShapeSetting.ShapeColorValuePath = "Weather"; layer1.ShapeSetting.ShapeFill = "#8DCEFF"; layer1.ShapeSetting.ShapeStrokeThickness = 0.5; layer1.ShapeSetting.ShapeStroke = "#2F8CEA"; layer1.BubbleSetting.AutoFillColors = false; layer1.BubbleSetting.MaxSize = 30; layer1.BubbleSetting.MinSize = 10; layer1.BubbleSetting.ValuePath = "Weather"; layer1.BubbleSetting.ColorValuePath = "Weather"; layer1.BubbleSetting.ColorMappings = new System.Collections.ObjectModel.ObservableCollection <ColorMapping>(); layer1.BubbleSetting.ColorMappings.Add(new RangeColorMapping { From = 0, To = 30, Color = System.Drawing.Color.FromArgb(0x8C, 0x5F, 0xD3) }); layer1.BubbleSetting.ColorMappings.Add(new RangeColorMapping { From = 30, To = 35, Color = System.Drawing.Color.FromArgb(0xEF, 0x6A, 0xB3) }); layer1.BubbleSetting.ColorMappings.Add(new RangeColorMapping { From = 35, To = 40, Color = System.Drawing.Color.FromArgb(0x8A, 0xC6, 0x3C) }); layer1.BubbleSetting.ColorMappings.Add(new RangeColorMapping { From = 40, To = 50, Color = System.Drawing.Color.FromArgb(0xF7, 0x9E, 0x46) }); SubShapeFileLayer layer2 = new SubShapeFileLayer(); layer2.Uri = "australia.shp"; layer2.ItemSource = viewmodel.OceaniaList; layer2.ShapeIDPath = "NAME"; layer2.ShapeIDTableField = "ADMIN_NAME"; layer2.ShapeSetting.ShapeValuePath = "Weather"; layer2.ShapeSetting.ShapeColorValuePath = "Weather"; layer2.ShapeSetting.ShapeFill = "#8DCEFF"; layer2.ShapeSetting.ShapeStrokeThickness = 0.5; layer2.ShapeSetting.ShapeStroke = "#2F8CEA"; layer2.BubbleSetting.AutoFillColors = false; layer2.BubbleSetting.MaxSize = 30; layer2.BubbleSetting.MinSize = 10; layer2.BubbleSetting.ValuePath = "Weather"; layer2.BubbleSetting.ColorValuePath = "Weather"; layer2.BubbleSetting.ColorMappings = new System.Collections.ObjectModel.ObservableCollection <ColorMapping>(); layer2.BubbleSetting.ColorMappings.Add(new RangeColorMapping { From = 0, To = 20, Color = System.Drawing.Color.FromArgb(0x8C, 0x5F, 0xD3) }); layer2.BubbleSetting.ColorMappings.Add(new RangeColorMapping { From = 20, To = 25, Color = System.Drawing.Color.FromArgb(0xEF, 0x6A, 0xB3) }); layer2.BubbleSetting.ColorMappings.Add(new RangeColorMapping { From = 25, To = 30, Color = System.Drawing.Color.FromArgb(0x8A, 0xC6, 0x3C) }); layer2.BubbleSetting.ColorMappings.Add(new RangeColorMapping { From = 30, To = 35, Color = System.Drawing.Color.FromArgb(0xF7, 0x9E, 0x46) }); shapeLayer.SubShapeFileLayers.Add(layer1); shapeLayer.SubShapeFileLayers.Add(layer2); #endregion this.mapsControl1.Layers.Add(shapeLayer); }