public PointOnPath( Wrld.Space.LatLong resultPoint, Wrld.Space.LatLong inputPoint, double distanceFromInputPoint, double fractionAlongPath, int indexOfPathSegmentStartVertex, int indexOfPathSegmentEndVertex ) { ResultPoint = resultPoint; InputPoint = inputPoint; DistanceFromInputPoint = distanceFromInputPoint; FractionAlongPath = fractionAlongPath; IndexOfPathSegmentStartVertex = indexOfPathSegmentStartVertex; IndexOfPathSegmentEndVertex = indexOfPathSegmentEndVertex; }
public PointOnPath GetPointOnPath(Wrld.Space.LatLong inputPoint, List <Wrld.Space.LatLong> polylinePathPoints) { var pathPointsBuffer = new LatLongInterop[polylinePathPoints.Count]; for (int i = 0; i < polylinePathPoints.Count; ++i) { pathPointsBuffer[i] = LatLongInterop.FromLatLong(polylinePathPoints[i]); } var pathPointsBufferGCHandle = GCHandle.Alloc(pathPointsBuffer, GCHandleType.Pinned); var bufferPtr = pathPointsBufferGCHandle.AddrOfPinnedObject(); var inputPointInterop = LatLongInterop.FromLatLong(inputPoint); var resultInterop = NativePathApi_GetPointOnPath(NativePluginRunner.API, inputPointInterop, bufferPtr, pathPointsBuffer.Length); var result = resultInterop.FromInterop(); pathPointsBufferGCHandle.Free(); return(result); }