我正在使用Rubymotion开发iOS应用程序。 在这个应用程序中,我希望能够在地图上向用户显示他或她驾驶或行走的方式。我还想在服务器上保存这条路径。
如何在iOS中跟踪此补丁?
欢迎所有关于解决方案的输入和提示。
答案 0 :(得分: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
所有这些都是BubbleWrap:https://github.com/rubymotion/BubbleWrap