android - 使用 maps api android sdk 搜索位置

标签 android search google-maps

当人们在EditText 部分按下 Button 我希望 map 转到该位置。如果有人有任何关于如何这样做的信息,甚至是教程,我们将不胜感激。

谢谢。

最佳答案

String uri = "geo:"+ latitude + "," + longitude;

startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri)));

或带有地址:

geo:latitude,longitude
geo:latitude,longitude?z=zoom
geo:0,0?q=my+street+address
geo:0,0?q=business+near+city

http://developer.android.com/guide/appendix/g-app-intents.html

例如:

Uri uri = Uri.parse("geo:38.899533,-77.036476");
Intent it = new Intent(Intent.Action_VIEW,uri);
startActivity(it);

用于导航:

Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" + location)); 
startActivity(i);

关于android - 使用 maps api android sdk 搜索位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6271416/

相关文章:

java - 四舍五入到小数点后两位

visual-studio-2008 - 在文件中查找 : Search all code in Team Foundation Server

javascript - 使用 ng-map/angularjs-google-maps 在 javascript 中检索当前位置

java - 将标记放置在 Android 谷歌地图中后立即启动标记拖动事件

google-maps - 使用 Google Maps API 找不到位置

java - 在 Android 中使用 createScaledBitmap 创建缩放位图

android - 将消息从我的 IntentService 发送回 Activity 的正确方法是什么?

c# - Linq多关键字搜索

javascript - MongoDB:$or 一个全文搜索和一个 $in

java - 正则表达式没有前导点和最大一个前导零