简体   繁体   English

我可以将地址传递给Android的Google Maps API,该地址将使用请求的地址打开Goog​​le地图吗?

[英]Can I pass an address to Google maps API for Android that will open Google maps with the requested address?

I´m new to the Android world, 我是Android世界的新手,

I want to write an application for Android that will receive a destination address from a central server, opening the Google maps showing the routing from the current location to the requested destination. 我想编写一个适用于Android的应用程序,该应用程序将从中央服务器接收目标地址,然后打开Goog​​le地图,显示从当前位置到请求的目标的路线。 There will be many clients (cellular phones). 将会有很多客户(手机)。

I want to ask 1) Is it possible to do it with the Google maps API ? 我想问的是1)是否可以使用Google Maps API做到这一点?

2) Regarding Google map licensing, I read different answers in this forum and I´m not sure I understood, Is a Google map license required? 2)关于Google地图许可,我在此论坛上阅读了不同的答案,但不确定我是否理解,是否需要Google地图许可?

3) If anyone has worked with OpenGts, is it recommended as a server? 3)如果有人使用过OpenGts,建议将其用作服务器吗? and can it save data to a local database (eg MYSQL) Thanks, 并可以将数据保存到本地数据库(例如MYSQL)吗?谢谢,

1) Yes, it's possible. 1)是的,有可能。 The way I went when I worked on a Google maps project was that: 我从事Google Maps项目的方式是:

First, using the Google Maps for Android API, put a map in your application. 首先,使用Google Maps for Android API将地图放入您的应用程序。

Using the GPS, detect your position. 使用GPS检测您的位置。 Then, just send a request to the Google Maps online API to generate you a path between your two location. 然后,只需向Google Maps在线API发送请求即可为您生成两个位置之间的路径。

Google maps will then answer you with the encrypted path to use (use this algorithm to decrypt the path http://jeffreysambells.com/2010/05/27/decoding-polylines-from-google-maps-direction-api-with-java ). 然后,Google地图将使用要加密的路径来回答您(使用此算法解密路径http://jeffreysambells.com/2010/05/27/decoding-polylines-from-google-maps-direction-api-with- java )。

Once this is done, do whatever you want with the path. 完成此操作后,对路径进行任何操作。 Know that the easiest thing to do, is to create a polyline thanks to the path, and then display it on the map. 要知道,最简单的方法就是借助该路径创建一条折线,然后将其显示在地图上。 If you want to do a real GPS, the easiest thing to do would be to use intents between the Google Navigation App and your informations ( Android - Launching Google Navigation from an app ) 如果您想做一个真实的GPS,最简单的方法就是在Google导航应用和您的信息之间使用意图( Android-从应用启动Google导航

2) For the integration of the map in your application, you have to request a Goole Maps for Android API key, that you can find in the Google Api Console : https://code.google.com/apis/console For the Google Maps web service API, no key is required. 2)为了将地图集成到您的应用程序中,您必须请求一个Goole Maps for Android API密钥,您可以在Google Api Console中找到该密钥: https : //code.google.com/apis/console对于Google Maps Web服务API,不需要密钥。

I let someone else answer to your 3). 我让别人回答您​​的问题3)。

More informations : 更多信息:

Google Maps API web service : https://developers.google.com/maps/documentation/webservices/?hl=fr Google Maps API网络服务: https : //developers.google.com/maps/documentation/webservices/?hl=fr

Introduction to Google Maps Android API v2 https://developers.google.com/maps/documentation/android/ Google Maps Android API v2简介https://developers.google.com/maps/documentation/android/

Google Maps for Android API http://www.vogella.com/articles/AndroidGoogleMaps/article.html Google Maps for Android API http://www.vogella.com/articles/AndroidGoogleMaps/article.html

Hope this helps! 希望这可以帮助!

1) Of course. 1)当然。 You can use Google Maps API Web Services: here . 您可以使用Google Maps API Web服务: 此处 The web service give you a path described in json format, so you have to parse the result and draw the path on the map. Web服务为您提供了以json格式描述的路径,因此您必须解析结果并在地图上绘制路径。 You can use MapView for showing the path from source to destination. 您可以使用MapView显示从源到目标的路径。 Here a tutorial from android developer site. 是来自android开发人员网站的教程。

2) If you want know if you can use Google maps for commercial applications, the answer is that Google maps can be use for some commercial application. 2)如果您想知道是否可以将Google地图用于商业应用,则答案是Google地图可以用于某些商业应用。 "not all commercial uses are allowed. If your site meets any of the following criteria you must use Google Maps API Premier" More details here “不是所有的商业用途是允许的。如果您的网站符合任何你必须使用谷歌地图API总理下列标准”更多的细节在这里

3) Yes, OpenGts supports Google Maps as you can see here 3)是的,您可以在此处看到OpenGts支持Google Maps

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM