菜鸟教程小白 发表于 2022-12-11 17:53:33

ios - 在 iOS 的 Google Maps SDK 中启用方向


                                            <p><p>当我点击 <code>GMSMarker</code> 时,我想启用方向和 map ,如下图所示。它在android中运行良好。</p>

<p> <a href="/image/Gn4VG.jpg" rel="noreferrer noopener nofollow"><img src="/image/Gn4VG.jpg" alt="Like Red Color Box"/></a> </p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>你检查过这个<a href="https://developers.google.com/maps/documentation/ios-sdk/marker" rel="noreferrer noopener nofollow">Maps SDK for iOS</a>文件?您可以使用 <a href="https://developers.google.com/maps/documentation/directions/" rel="noreferrer noopener nofollow">Google Directions API</a>请求方向,然后使用从服务返回的编码路径绘制 <a href="https://developers.google.com/maps/documentation/ios/reference/interface_g_m_s_polyline" rel="noreferrer noopener nofollow">GMSPolyline</a>使用 <a href="https://developers.google.com/maps/documentation/ios/reference/interface_g_m_s_path#a4060269354374332afbb532557c4899e" rel="noreferrer noopener nofollow">GMSPath&#39;s pathFromEncodedPath:</a>方法。</p>

<p>这是一个相关的 SO 线程:<a href="https://stackoverflow.com/questions/20905797/google-maps-ios-sdk-getting-directions-between-2-locations" rel="noreferrer noopener nofollow">Google Maps iOS SDK, Getting Directions between 2 locations</a> .这个<a href="https://www.raywenderlich.com/109888/google-maps-ios-sdk-tutorial" rel="noreferrer noopener nofollow">blog tutorial</a>也可能有帮助。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 在 iOS 的 Google Maps SDK 中启用方向,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/40147724/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/40147724/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 在 iOS 的 Google Maps SDK 中启用方向