private void GraphicsLayer_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs e) { Polyline polyline = e.Graphic.Geometry as Polyline; Envelope current = polyline.Extent; Envelope expand = current.Expand(10); Polyline scaled = new Polyline(); double sx = current.Width > 0 ? expand.Width / current.Width : 1d; double sy = current.Height > 0 ? expand.Height / current.Height : 1d; foreach (var path in polyline.Paths) { PointCollection pts = new PointCollection(); foreach (var p in path) pts.Add(new MapPoint((p.X - current.XMin) * sx + expand.XMin, (p.Y - current.YMin) * sy + expand.YMin)); scaled.Paths.Add(pts); } e.Graphic.Geometry = scaled; }
esri:Editor.SnapDistance="20" esri:Editor.SnapKey="S"
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.