How create arc on map in ArcGis API for IOS?

99
2
Jump to solution
a week ago
dmitriymikhaylov
New Contributor

Hello everybody, I am trying to add an arc element to the map, but I have no idea how to do it, I have not found any information about it in the available manuals, please help, there is a method with which I tried to create an arc:

let arc = AGSEllipticArcSegment.createcircularellipticarc(withcenter: AGSPoint(x:0.0, y:0.0, SpatialReference: .wgs84()), radius: 55.8413245857547, startAngle: 0, centralAngle: 180, SpatialReference: .wgs84())

but to display on the map, you need to add this element to the graphics, but do it like this:

let graphic = AGSGraphic(geometry: arc, symbol:fillsymbol, attributes: nil)

is not allowed because AGSEllipticArcSegment does not translate to AGSGeometry if possible, I would like to see an example of how to display a similar thing on a map

0 Kudos
1 Solution

Accepted Solutions
Ting
by Esri Contributor
Esri Contributor

Hi, Please check out the iOS sample code here: https://github.com/Esri/arcgis-runtime-samples-ios/blob/main/arcgis-ios-sdk-samples/Display%20inform... that adds both Bezier and Elliptic arcs.

With the current API, you'll need to first create an `AGSPart`, then add all the curve segments to the part, and then add the part to a polygon builder.

If you read Kotlin, here is the Android sample code: https://github.com/Esri/arcgis-runtime-samples-android/blob/a7c8dd3d27cab7937ede19c641c0a9e9b32b6b0f... .

Ideally we'll add the same convenience API to iOS SDK in the future, that allows you to directly create a polygon with curvatures from an `AGSPart` object.

View solution in original post

0 Kudos
2 Replies
Ting
by Esri Contributor
Esri Contributor

Hi, Please check out the iOS sample code here: https://github.com/Esri/arcgis-runtime-samples-ios/blob/main/arcgis-ios-sdk-samples/Display%20inform... that adds both Bezier and Elliptic arcs.

With the current API, you'll need to first create an `AGSPart`, then add all the curve segments to the part, and then add the part to a polygon builder.

If you read Kotlin, here is the Android sample code: https://github.com/Esri/arcgis-runtime-samples-android/blob/a7c8dd3d27cab7937ede19c641c0a9e9b32b6b0f... .

Ideally we'll add the same convenience API to iOS SDK in the future, that allows you to directly create a polygon with curvatures from an `AGSPart` object.

View solution in original post

0 Kudos
dmitriymikhaylov
New Contributor

Thank you very much for the answer! This information will be very useful for solving this problem, if I make the necessary calculations and add the results to the polyline element, then I will get what I need.

0 Kudos