createWithAltitudeReferenceSystem method

Geopoint createWithAltitudeReferenceSystem(
  1. BasicGeoposition position,
  2. AltitudeReferenceSystem altitudeReferenceSystem
)

Implementation

Geopoint createWithAltitudeReferenceSystem(BasicGeoposition position,
    AltitudeReferenceSystem altitudeReferenceSystem) {
  final retValuePtr = calloc<COMObject>();

  final hr =
      ptr.ref.vtable
              .elementAt(7)
              .cast<
                  Pointer<
                      NativeFunction<
                          HRESULT Function(
                              Pointer,
                              BasicGeoposition position,
                              Int32 altitudeReferenceSystem,
                              Pointer<COMObject>)>>>()
              .value
              .asFunction<
                  int Function(Pointer, BasicGeoposition position,
                      int altitudeReferenceSystem, Pointer<COMObject>)>()(
          ptr.ref.lpVtbl,
          position,
          altitudeReferenceSystem.value,
          retValuePtr);

  if (FAILED(hr)) {
    free(retValuePtr);
    throw WindowsException(hr);
  }

  return Geopoint.fromRawPointer(retValuePtr);
}