Android Studio - 谷歌地图搜索

标签 android google-maps

我想实现一种类似于谷歌搜索 map 的方法,用户可以在其中输入地址,点击按钮,然后转到他们提供的地址,有没有什么地方可以让我在线阅读,谢谢,

最佳答案

从 Google 的官方文档中查看:https://developers.google.com/maps/documentation/android/

如果您喜欢视频教程:https://www.youtube.com/watch?v=awX5T-EwLPc

如果您只想启动 Google map 应用:

Uri gmmIntentUri = Uri.parse("geo:37.7749,-122.4194");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);

Use this intent to display search queries within a specified viewport. When the query has a single result, you can use this intent to display a pin at a particular place or address, such as a landmark, business, geographic feature, or town.

geo:latitude,longitude?q=query
geo:0,0?q=my+street+address
geo:0,0?q=latitude,longitude(label)

更多信息在 https://developers.google.com/maps/documentation/android/intents .

关于Android Studio - 谷歌地图搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31619194/

相关文章:

javascript - 当我点击谷歌地图中的箭头图标时谷歌地图 [$parse :syntax] error?

Android - 创建自定义 SearchView

android - 应用程序卸载时的 SQLite 数据库状态

Android:如何动态地在屏幕的一部分上制作 Canvas ?

javascript - 未定义的 JavaScript 函数?

javascript - 在Polygon的基础上获取 map 瓦片

java - Google Map Api v2 不显示任何 map

android - 在 android kotlin 中以编程方式创建联系人并将其共享为 v-card/vcf 文件

Android:如何将 "Custom View"动态添加到线性布局中

javascript - 谷歌嵌入API。我可以传递纬度和经度,同时在生成的弹出窗口中显示地址的文本表示形式吗