Select to view content in your preferred language

i want to edit poly line geometry at international date line,i had tryed but its divided into parts as shown in picture,how we edit geometry

540
0
06-26-2020 05:38 AM
balajipanyam
Emerging Contributor

actually am storing coordinates in database,when i click on the data row grid i had sucessfuly place the geometry,now i want to edit that dispaly line,so when i click on edit line,that line had divided into parts,,am using fallowing script for edit button &i had attched the images displaying for your reference 

private async void EditButton_Click(object sender, RoutedEventArgs e)
{
// btnSaveRout.IsEnabled = true;
_sketchOverlay.Graphics.Clear();
routewaypointoverlay.Graphics.Clear();
// var temprouteline = MyMapView.SketchEditor.Geometry;
var item=routeline;
var item1 = geom;
try
{
if (item != null || item1!=null)
{
Esri.ArcGISRuntime.Geometry.Polyline poly = (Esri.ArcGISRuntime.Geometry.Polyline)GeometryEngine.NormalizeCentralMeridian(geom);
if (poly.Parts.Count > 1)
{
var tempgraphic = coordinatesystem_polyline_new(poly);
foreach (var items in tempgraphic)
{
var ge = Graphiccoordinates_Aftertransform(items);
var graphic = new Graphic(ge);
var config = new SketchEditConfiguration()
{
AllowVertexEditing = true,
AllowMove = true,
AllowRotate = false,

ResizeMode = SketchResizeMode.None
};


// Geometry_OnviewTap(graphic);
// Geometry_OnviewTap(item);
}
sketchEditor();

Esri.ArcGISRuntime.Geometry.Geometry newGeometry = await MyMapView.SketchEditor.StartAsync(geom);
}

else
{
Graphic editGraphic = item;
var edititem = Graphiccoordinates_Aftertransform_wgs84_webmerc(editGraphic.Geometry);
// Esri.ArcGISRuntime.Geometry.Polyline poly1 = (Esri.ArcGISRuntime.Geometry.Polyline)GeometryEngine.NormalizeCentralMeridian(edititem);
Graphic newGraphic = null;
var config = new SketchEditConfiguration()
{
AllowVertexEditing = true,
AllowMove = true,
AllowRotate = false,

ResizeMode = SketchResizeMode.None
};
sketchEditor();
// route_symbolsadding(loadpoints);
// var graphic_aftertransform = Graphiccoordinates_Aftertransform(editGraphic);
// editGraphic = coordinatesystem_polyline(graphic_aftertransform);
if (editGraphic == null) { return; }
// Let the user make changes to the graphic's geometry, await the result (updated geometry)
Esri.ArcGISRuntime.Geometry.Geometry newGeometry = await MyMapView.SketchEditor.StartAsync(edititem);

// Display the updated geometry in the graphic
editGraphic.Geometry = newGeometry;
newGraphic = coordinatesystem_polyline(newGeometry);
var editPolyline1 = newGraphic.Geometry as Polyline;
this.editlinebuilder = new PolylineBuilder(editPolyline1);
foreach (var r in polylineBuilder.Parts)
{
editlinemp = r.Points;

}
_sketchOverlay.Graphics.Add(newGraphic);
route_symbolsadding(editlinemp);
// editGraphic.IsVisible = false;
}


}


//item1 = null;

}
catch (TaskCanceledException)
{
// Ignore ... let the user cancel editing
}
catch (Exception ex)
{
// Report exceptions
MessageBox.Show("Error editing shape: " + ex.Message);
}
// btnSaveRout.IsEnabled = false;
}

0 Kudos
0 Replies