Use the GeometryEngine to calculate a geodesic path between two points and measure its distance.
Click on the map to select a path destination. The geodesic path between the two points will update.
- Create a
Polyline
using two points. - Pass this polyline to:
GeometryEngine.densifyGeodetic(polyline, segmentLength, unitOfMeasurement, GeodeticCurveType.GEODESIC)
. This will create a new polyline with segments of lengthsegmentLength
andLinearUnit
set tounitOfMeasurement
. The curve will be geodesic. - You can set this geometry to a
Graphic
to display the curve in aGraphicsOverlay
. - To get the distance, use
GeometryEngine.lengthGeodetic(pathGeometry, unitOfMeasurement, GeodeticCurveType.GEODESIC)
- ArcGISMap
- GeodeticCurveType
- Geometry
- GeometryEngine
- Graphic
- GraphicsOverlay
- LinearUnit
- LinearUnitId
- MapView
- Point
- PointCollection
- Polyline
- SimpleLineSymbol
- SimpleMarkerSymbol
Analysis Geometry Polyline GeometryEngine