(Android)使用搜索和默认书签打开Goog​​le Maps吗?

时间:2019-01-02 02:47:33

标签: android

我正在整理一个应用程序,其中一个按钮会打开Goog​​le Maps。这个想法是,当Google Maps打开时,它将以默认搜索打开,我的意思是,当打开Goog​​le Maps时,它将以搜索打开,例如,“冰淇淋店”,这样用户将知道哪些冰淇淋店。在他们的地区。怎么做?谢谢!

2 个答案:

答案 0 :(得分:0)

您可以使用Google Place Api

首先致电Google Place Api并找到您附近的所有“冰淇淋商店”,它返回带有经度和长期的商店列表

从位置api获取结果后,将所有标记添加到您的Google地图上

希望这会对您有所帮助。

答案 1 :(得分:0)

// Search for ice cream shops nearby
Uri gmmIntentUri = Uri.parse("geo:0,0?q=ice+cream+shops");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);

Documentation