SketchEditor Polyline

218
4
3 weeks ago
Labels (1)
NACHIKETA
New Contributor II

 

I'm currently using ArcGIS Runtime 100.15.4 SDK for .net , and I'm encountering an issue while attempting to draw a polyline on the map in the application im developing .

Here's the code snippet I'm using:

Geometry geometry = await mapView.SketchEditor.StartAsync(SketchCreationMode.Polyline, true);
 

 the task returned by StartAsync is getting canceled.

Any insights or suggestions on how to resolve this.
Suggest me some documentations on Drawing Geometries on map Runtime. 

0 Kudos
4 Replies
dotMorten_esri
Esri Notable Contributor

If a sketch is already in progress, the already-running sketch task will get cancelled and throw the Task canceled exception when a new start call is made. You should always handle that exception in your sketch tasks (generally you can ignore it and do any necessary cleanup, since it's often an expected thing to happen).

0 Kudos
NACHIKETA
New Contributor II

hi, im unable to fix it , the startAsync method is returning TaskCancelled exception , although im able to draw other geometries but the problem arises when im trying to draw polyline,polygon and multipoint.

0 Kudos
dotMorten_esri
Esri Notable Contributor

You're not able to try/catch the exception? Is the exception happening the first time you call StartAsync or on subsequent calls?
Do you have a small sample that reproduces the problem?

0 Kudos
NACHIKETA
New Contributor II

Yes the exception is happening on the first call of StartAsync, this problem arised when we migrated from ArcGISRuntime v100.6 to 100.15.4. 

this is the code snippent we used:-
SketchCreationMode creationMode = SketchCreationMode.Polyline;
Geometry geometry = await mapView.SketchEditor.StartAsync(creationMode, true);

The moment we click on the Mapview ,the Exception of task being cancelled is showing up.

0 Kudos