arcGIS for android如何画一条弯曲的线?

arcGIS for android如何画一条弯曲的线?,android,arcgis,arcgis-js-api,arcgis-server,Android,Arcgis,Arcgis Js Api,Arcgis Server,我的项目满足了在ArcGIS地图上绘制曲线路径的需要,但我使用了很多方法,不知道如何在代码中绘制曲线。我尝试了多种不同的方法,但似乎都不起作用。有什么想法吗?先谢谢你 好的,我理解您希望使用ArcGIS android sdk在地图上添加一条曲线的要求 首先,你需要一组坐标,用来在地图上画线 // create a line symbol (green, 3 thick and a dash style) SimpleLineSymbol lineSymbol = new SimpleLineS

我的项目满足了在ArcGIS地图上绘制曲线路径的需要,但我使用了很多方法,不知道如何在代码中绘制曲线。我尝试了多种不同的方法,但似乎都不起作用。有什么想法吗?先谢谢你

好的,我理解您希望使用ArcGIS android sdk在地图上添加一条曲线的要求

首先,你需要一组坐标,用来在地图上画线

// create a line symbol (green, 3 thick and a dash style)
SimpleLineSymbol lineSymbol = new SimpleLineSymbol(Color.GREEN, 3, SimpleLineSymbol.STYLE.DASH);

// create the line geometry
Polyline lineGeometry = new Polyline();
lineGeometry.startPath(-302557, 7570663);
lineGeometry.lineTo(-302959, 7570868);
lineGeometry.lineTo(-303042, 7571220);
lineGeometry.lineTo(-302700, 7571803);
lineGeometry.lineTo(-304043, 7576654);
lineGeometry.lineTo(-300544, 7585289);
lineGeometry.lineTo(-294365, 7592435);
lineGeometry.lineTo(-290122, 7594445);
lineGeometry.lineTo(-285283, 7595488);

// create the graphic using the geometry and the symbol
Graphic lineGraphic = new Graphic(lineGeometry, lineSymbol);

// add the graphic to the graphics layer
graphicsLayer.addGraphic(lineGraphic);
可以将多段线添加到图形图层并使用SimpleLineSymbol显示。此符号允许您使用有限的符号类型列表(虚线、虚线点、虚线点、点、空或实心)之一显示图形。可以通过指定宽度和颜色来进一步定义符号

下面是一些线条符号的示例-

确定线条符号样式后,请使用下面的代码在地图上添加线条

// create a line symbol (green, 3 thick and a dash style)
SimpleLineSymbol lineSymbol = new SimpleLineSymbol(Color.GREEN, 3, SimpleLineSymbol.STYLE.DASH);

// create the line geometry
Polyline lineGeometry = new Polyline();
lineGeometry.startPath(-302557, 7570663);
lineGeometry.lineTo(-302959, 7570868);
lineGeometry.lineTo(-303042, 7571220);
lineGeometry.lineTo(-302700, 7571803);
lineGeometry.lineTo(-304043, 7576654);
lineGeometry.lineTo(-300544, 7585289);
lineGeometry.lineTo(-294365, 7592435);
lineGeometry.lineTo(-290122, 7594445);
lineGeometry.lineTo(-285283, 7595488);

// create the graphic using the geometry and the symbol
Graphic lineGraphic = new Graphic(lineGeometry, lineSymbol);

// add the graphic to the graphics layer
graphicsLayer.addGraphic(lineGraphic);
上述代码的输出

有关更多详细信息,请参阅


希望这能对你有所帮助:)

这对我帮助很大。非常感谢。