2013-07-10 37 views
0

我正在開發一個使用Rubymotion的iOS應用程序。 在這個應用程序中,我希望能夠在地圖上向用戶顯示他或她駕駛或走過的路線。我也想在服務器上保存這個路徑。如何在地圖上跟蹤用戶路徑?

如何在iOS中跟蹤此修補程序?

歡迎提供有關解決方案的所有輸入和提示。

回答

1

我猜你的應用程序需要一個計時器:

count = 0 
timer = EM.add_periodic_timer 1.0 do 
    count = count + 1 
    puts "Great scott!" 
    (count < 10) || EM.cancel_timer(timer) 
end 

,然後找到當前位置:

BW::Location.get do |result| 
    p "From Lat #{result[:from].latitude}, Long #{result[:from].longitude}" 
    p "To Lat #{result[:to].latitude}, Long #{result[:to].longitude}" 
end 

這一切都是氣泡布:https://github.com/rubymotion/BubbleWrap

+0

看起來很有趣。我應該如何一起使用它們?我該如何使用計時器? –

+4

對不起,你必須自己做思考部分 – phoet