convertCoordinate method

CGPoint convertCoordinate(
  1. CLLocationCoordinate2D coordinate, {
  2. UIView? toPointToView,
})

Converts a geographic coordinate to a point in the given view’s coordinate system.

@param coordinate The geographic coordinate to convert. @param view The view in whose coordinate system the returned point should be expressed. If this parameter is nil, the returned point is expressed in the window’s coordinate system. If view is not nil, it must belong to the same window as the map view. @return The point (in the appropriate view or window coordinate system) corresponding to the given geographic coordinate.

  • TODO: Point conversion: learn how to convert a map coordinate to a CGPoint object.

Implementation

objc.CGPoint convertCoordinate(CLLocationCoordinate2D coordinate, {UIView? toPointToView}) {
  final _ptr = pkg_ffi.calloc<objc.CGPoint>();
  objc.useMsgSendVariants ? _objc_msgSend_mus1wvStret(_ptr, this.ref.pointer, _sel_convertCoordinate_toPointToView_, coordinate, toPointToView?.ref.pointer ?? ffi.nullptr) : _ptr.ref = _objc_msgSend_mus1wv(this.ref.pointer, _sel_convertCoordinate_toPointToView_, coordinate, toPointToView?.ref.pointer ?? ffi.nullptr);
  final _finalizable = _ptr.cast<ffi.Uint8>().asTypedList(
      ffi.sizeOf<objc.CGPoint>(), finalizer: pkg_ffi.calloc.nativeFree);
  return ffi.Struct.create<objc.CGPoint>(_finalizable);

}