我想实现一种类似于谷歌搜索 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/