不具合
不具合 ID 番号 | BUG-000175276 |
---|---|
送信されました | March 24, 2025 |
最終更新日 | April 17, 2025 |
適用対象 | ArcGIS Maps SDK for .NET |
見つかったバージョン | 200.6 |
オペレーティング システム | Windows OS |
オペレーティング システムのバージョン | 10.0 64 Bit |
ステータス | In Review |
Calculate the centroid of the polyline and label the point graphics instead of the polyline using the methods below:
public MapPoint GetPolylineCenterPoint(Polyline polyline)
{
// Ensure the polyline has points
if (polyline.Parts.Count == 0 || polyline.Parts.First().Points.Count == 0)
{
return null;
}
// Flatten all points in the polyline
var allPoints = polyline.Parts.SelectMany(part => part.Points).ToList();
// Calculate the average of the X and Y coordinates
double avgX = allPoints.Average(point => point.X);
double avgY = allPoints.Average(point => point.Y);
// Create and return the center point
return new MapPoint(avgX, avgY, polyline.SpatialReference);
}
不具合 ID: BUG-000175276
ソフトウェア:
ArcGIS エキスパートのサポートを受ける
Esri Support アプリのダウンロード