gpt4 book ai didi

ios - Rubymotion MapKit 路径叠加

转载 作者:行者123 更新时间:2023-11-29 04:18:30 27 4
gpt4 key购买 nike

有人知道使用 RubyMotion 在 MKMapView 上显示路径的代码示例吗?

我发现了一些显示点或图钉的有用示例,但没有一个显示路径。

谢谢

最佳答案

根据记录,我能够像这样在 map 上画一条线。希望这对某人有用,因为我找不到使用 RubyMotion 在 map 上绘制线条的示例:

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

关于ios - Rubymotion MapKit 路径叠加,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13337562/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com