2012-11-12 34 views
0

有誰知道任何使用RubyMotion在MKMapView上顯示路徑的代碼示例?Rubymotion MapKit Path Overlay

我發現了一些有用的例子,顯示一個點或pin但沒有顯示路徑。

謝謝

+0

對於我能畫一條線的記錄像這樣的地圖: – Bruce

回答

1

爲了記錄,我能夠在這樣的地圖上畫一條線。希望這是有用的人,因爲我可以用RubyMotion發現沒有例子在地圖上繪製線條:

arr = [CLLocationCoordinate2D.new(49.7414435, -123.08), CLLocationCoordinate2D.new(50.7414435, -123.0)] 
ptr = Pointer.new(CLLocationCoordinate2D.type, arr.length) 
ptr[0] = arr[0] 
ptr[1] = arr[1] 
pl = MKPolyline.polylineWithCoordinates(ptr, count:2) 
view.addOverlay(pl) 

隨着討論的幫助: https://groups.google.com/forum/?fromgroups=#!topic/rubymotion/F5CH780lu7c

+0

您用於在地圖上顯示的完整代碼是什麼?我嘗試了你的代碼,不幸地在地圖上繪製。 –