0

アップルのドキュメントによると、visibleMapRect を呼び出すと MKMapRect のインスタンスが返されるはずですが、代わりに MKCoordinateRegion を取得しています。

 class MyMapController < UIViewController
  def loadView
    super
    self.view = MKMapView.alloc.init
    view.delegate = self
  end

  def viewDidLoad
    region = MKCoordinateRegionMake(
      CLLocationCoordinate2D.new(20.7103500366211, -101.607849121094),
      MKCoordinateSpanMake(18, 18)
    )

    view.setRegion region, animated: false
  end

  def mapView map, regionDidChangeAnimated: animated
    puts map.visibleMapRect.inspect
    # prints => <MKCoordinateRegion center=#<CLLocationCoordinate2D latitude=47967664.0 longitude=106401408.0> span=#<MKCoordinateSpan latitudeDelta=20971520.0 longitudeDelta=24051712.0>>
  end
end
4

1 に答える 1

0

どうやらそれは RubyMotion のバグです:

やあ、

これはコンパイラのバグである可能性があります。両方の構造体が同じシグネチャ (同じフィールド タイプ) を持つ可能性があるため、コンパイラは混乱します。これについては、今後のソフトウェア アップデートで調査します。

よろしく。ローラン

于 2012-12-05T08:10:32.257 に答える