菜鸟教程小白 发表于 2022-12-11 20:02:03

ios - 在 iOS 的谷歌地图中获取中心


                                            <p><p>我在我的应用中添加了谷歌地图。它显示了从源到目的地的路径。</p>

<p>我还想显示估计时间,该路径的长度如下:</p>

<p> <a href="/image/YsFUD.png" rel="noreferrer noopener nofollow"><img src="/image/YsFUD.png" alt="Estimated Time"/></a> </p>

<p>如何使用谷歌地图计算路径中心?</p>

<p>感谢您宝贵的时间!</p>

<p>提前谢谢...</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>试试这个...</p>

<p>设坐标A = CLLocation(纬度:55.0,经度:35.0)</p>

<p>设坐标B = CLLocation(纬度:65.0,经度:73.0)</p>

<p>让 distanceInMeters =坐标A.距离(来自:坐标B)</p>

<p>计算完距离后,使用此公式计算速度。</p>

<p>即速度=距离/时间</p>

<p>试试这个委托(delegate)以获得速度或时间</p>

<p><strong>func locationManager(_ manager: CLLocationManager, didUpdateLocations 位置: )</strong></p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 在 iOS 的谷歌地图中获取中心,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/44899665/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/44899665/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 在 iOS 的谷歌地图中获取中心