是否可以使用 Google 地图在 Android/iOS 上创建逐向 GPS 导航应用程序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24531391/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 08:22:51  来源:igfitidea点击:

Is it possible to create turn-by-turn GPS navigation app on Android/iOS using Google Maps?

androidiosgoogle-mapsnavigationgps

提问by mz87

Today I've talked to a client and he wants to build a simple navigation APP on Android!

今天我和一个客户谈过,他想在Android上构建一个简单的导航APP!

Basically we could use Google maps, place some of "our" markers to show some locations (restaurants, hotels etc.) .. also we need to show user's friends near by!

基本上我们可以使用谷歌地图,放置一些“我们的”标记来显示一些位置(餐厅、酒店等)……我们还需要显示附近的用户朋友!

Everything of that is possible in Google Maps API on Android, except I can not find any useful information about Turn-by-turn navigation implementation inside my own app (without switching to Google Maps App) ..

在 Android 上的 Google Maps API 中,这一切都是可能的,除了我在我自己的应用程序中找不到有关精细导航实现的任何有用信息(无需切换到 Google 地图应用程序).​​.

Can someone simply clarify - is it possible to use Google Maps inside an Android app to create turn-by-turn GPS based app?

有人可以简单地澄清一下 - 是否可以在 Android 应用程序中使用谷歌地图来创建基于 GPS 的转向应用程序?

thanks

谢谢

采纳答案by DrkStr

Edit: Read answer by Tusharbelow before using this answer

编辑:在使用此答案之前阅读下面Tushar 的答案

First Option

第一个选项

If you want to implement the navigation completely in your app you will have to use a combination of the Google Maps API and the Google Directions API. They are free to use up to a limit and then you have to pay for the api requests.(https://developers.google.com/maps/documentation/directions/)

如果您想在您的应用程序中完全实现导航,则必须结合使用 Google Maps API 和 Google Directions API。它们可以免费使用,但您必须为 api 请求付费。(https://developers.google.com/maps/documentation/directions/

Second Option

第二种选择

I would just send the latitude and longitude of the location you want to navigate to the devices Maps app. Here is some code to start you off with this method:

我只想将您要导航到设备地图应用程序的位置的纬度和经度发送。这里有一些代码可以让你开始使用这个方法:

double lat = < latitude of the location you want to navigate to>

double lng = < longitude of the location you want to navigate to>     

String format = "geo:0,0?q=" + lat + "," + lng + "( Location title)";

Uri uri = Uri.parse(format); 


Intent intent = new Intent(Intent.ACTION_VIEW, uri);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);

This will open the device's Maps app and plot the location and the user can use the app to do what ever they want.

这将打开设备的地图应用程序并绘制位置,用户可以使用该应用程序做任何他们想做的事情。

I would go with the Second Option, it is stupidly easy to implement.

我会选择第二个选项,它非常容易实现。

回答by Tushar

I agree with the answer stated above but there is also a key clause in section 10.4.c of the google maps API privacy terms here.

我同意上述的答案,但也有在谷歌的部分10.4.c的关键条款Maps API的隐私条款这里

It states

它指出

No navigation. You will not use the Service or Content for or in connection with (a) real-time navigation or route guidance; or (b) automatic or autonomous vehicle control.

没有导航。您不会将服务或内容用于或与 (a) 实时导航或路线指导有关;(b) 自动或自主车辆控制。

Therefore I'd like to proceed and answer your question and say No, it is not possible to create a turn-by-turn navigation application on android by using Google Maps API without breaching their privacy policy.

因此,我想继续回答您的问题并说不,不可能在不违反隐私政策的情况下使用 Google Maps API 在 android 上创建逐向导航应用程序。

回答by Mehul Thakkar

After searching a lot, I have found two options for turn-by-turn navigation with voice instructions and arrow images.

经过大量搜索,我找到了两个带有语音说明和箭头图像的逐向导航选项。

  1. skobbler or sk maps (http://developer.skobbler.com/)
  2. HERE Maps (https://developer.here.com/)
  1. skobbler 或 sk 地图(http://developer.skobbler.com/
  2. 这里地图(https://developer.here.com/

HERE Maps is somewhat costly and does not allow free usage (only 90 days of trial period). But it has lots of advantages like:

HERE Maps 有点贵,并且不允许免费使用(只有 90 天的试用期)。但它有很多优点,例如:

  1. Clear and perfect documentation: The documentation they provide is clear and easily understandable, also the demo app they provide has all the required things implemented. So you can copy-and-paste many things.

  2. Developer friendly: Full control of maps for developers (no restrictions, you can do anything that you can think of with maps).

  3. Coverage: Navigation is not only clear and good for some specific countries, but for almost all countries. I have checked it in India for example. Apple Maps is not providing routes in India, Google Maps are providing it, but from my perspective, HERE Maps is much clearer and even better than Google.

  1. 清晰完美的文档:他们提供的文档清晰易懂,他们提供的演示应用程序也实现了所有必需的东西。所以你可以复制和粘贴很多东西。

  2. 开发人员友好开发人员完全控制地图(没有限制,你可以用地图做任何你能想到的事情)。

  3. 覆盖范围:导航不仅对某些特定国家/地区清晰且良好,而且几乎适用于所有国家/地区。例如,我在印度检查过它。Apple Maps 不提供印度的路线,Google Maps 提供,但在我看来,HERE Maps 比 Google 更清晰,甚至更好。

skobbler is good and allows free usage up to a limit, but it's not good for all countries (not covering India up to level). Also it is not that much developer friendly as HERE Maps.

skobbler 很好,并且允许在一定范围内免费使用,但它并不适用于所有国家/地区(不包括印度)。此外,它不像 HERE Maps 那样对开发人员友好。

回答by RoelandP

I stumbled upon this thread by searching for a turn-by-turn solution myself and I searched a bit further and found this promising javascript project:

我通过自己搜索逐步解决方案偶然发现了这个线程,我进一步搜索并找到了这个有前途的 javascript 项目:

FFWDme.js- is a JavaScript toolkit that aims to bring interactive GPS driving directions to the mobile browser

FFWDme.js-是一个 JavaScript 工具包,旨在为移动浏览器带来交互式 GPS 行车路线

It's open source. It's configurable, but by default it uses leaflet.js for slippy maps, and configurable Tile-server, so you could run it off Open-street maps. It also uses an opensource Graphhopperfor direction services, but you can add your own.

它是开源的。它是可配置的,但默认情况下它使用 Leaflet.js 来制作滑动地图,并使用可配置的 Tile-server,所以你可以在开放街道地图上运行它。它还使用开源Graphhopper提供方向服务,但您可以添加自己的。

Looks promising!

看起来很有希望!

回答by Clint

Creating turn by turn navigation using Google Maps API is not allowed in the Google Maps API ToS, even after the July 2018 pricing change where they updated their ToS.

Google Maps API ToS 中不允许使用 Google Maps API 创建逐向导航,即使在 2018 年 7 月他们更新了 ToS 的定价更改之后也是如此。

From Google Maps new ToS section 3.2.4(emphasis mine):

谷歌地图新的服务条款 3.2.4 节(强调我的):

(c) No Re-Creating Google Products or Features. Customer will not use the Services to create a product or service with features that are substantially similar to or that re-create the features of another Google product or service.Customer's product or service must contain substantial, independent value and features beyond the Google products or services. For example, Customer will not: (i) re-distribute the Google Maps Core Services or pass them off as if they were Customer's services; (ii) create a substitute of the Google Maps Core Services, Google Maps, or Google Maps mobile apps, or their features; (iii) use the Google Maps Core Services in a listings or directory service or to create or augment an advertising product; (iv) combine data from the Directions API, Geolocation API, and Maps SDK for Android to create real-time navigation functionality substantially similar to the functionality provided by the Google Maps for Android mobile app.

(c) 不得重新创建 Google 产品或功能。客户不得使用服务来创建产品或服务,其功能与其他 Google 产品或服务的功能基本相似或重新创建了其他 Google 产品或服务的功能。客户的产品或服务必须包含 Google 产品或服务之外的实质性、独立的价值和功能。例如,客户不得:(i) 重新分发 Google 地图核心服务或将其作为客户的服务进行分发;(ii) 创建谷歌地图核心服务、谷歌地图或谷歌地图移动应用程序或其功能的替代品;(iii) 在列表或目录服务中使用 Google 地图核心服务,或者创建或增强广告产品;(iv) 结合来自 Directions API、Geolocation API 和 Maps SDK for Android 的数据,以创建与 Google Maps for Android 移动应用程序提供的功能基本相似的实时导航功能。

回答by Ted

Not yet possible but google has some private partnerships

尚不可能,但谷歌有一些私人合作伙伴关系

Lyft introduced google maps navigation in-app https://thehub.lyft.com/blog/lyft-navigation-google-maps

Lyft 在应用内引入了谷歌地图导航 https://thehub.lyft.com/blog/lyft-navigation-google-maps