I want to draw polyline use SketchEditor in Android, but this SketchEditor always is null,why?
my code as follow:
btnEdit = FindViewById<Button>(Resource.Id.button1);
btnEdit.Click += (s, e) => {
try
{
SketchEditor se = new SketchEditor();
this._mapView.SketchEditor = se;
this._mapView.SketchEditor.StartAsync(SketchCreationMode.Polyline);
}
catch(Exception ex)
{
}
Really looking forward to answer
thanks
Solved! Go to Solution.
We are aware of this issue. This bug is already logged in our bug tracking system. We will try to get this fixed in upcoming release in summer. At this point , the workaround would be to create the layout in the activity and add the MapView from within the activity.
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
new MapView();
Map = new Map(Basemap.CreateImagery());
ButtonStart = new Button(this);
Text = "Start";
Click += BtnClickAsync;
AddView(ButtonStart);
AddView(_mapView);
layout);
}
We are aware of this issue. This bug is already logged in our bug tracking system. We will try to get this fixed in upcoming release in summer. At this point , the workaround would be to create the layout in the activity and add the MapView from within the activity.
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
layout = new LinearLayout(this) { Orientation = Orientation.Vertical };
new MapView();
Map = new Map(Basemap.CreateImagery());
ButtonStart = new Button(this);
Text = "Start";
Click += BtnClickAsync;
AddView(ButtonStart);
AddView(_mapView);
layout);
}
thanks for your answer, expect to fix the bug at early date