【问题标题】:How do I integrate a google maps with all the places and informations in my android app? Google Maps API如何将谷歌地图与我的 Android 应用程序中的所有地点和信息集成?谷歌地图 API
【发布时间】:2016-09-20 18:45:00
【问题描述】:

我需要在地图上显示更多的地方,因为我正在开发一个餐厅预订应用程序,而另一方面,当我使用谷歌地图应用程序时,整个城市都没有餐厅出现,我可以看到所有的地方和相关信息显示我可以在我的应用程序上获得完整的信息谷歌地图吗 屏幕 Google map screen

【问题讨论】:

  • 你应该首先阅读谷歌开发者网站中的谷歌地图API。你会得到基本的想法。

标签: google-maps android-layout android-fragments android-studio dictionary


【解决方案1】:

您可以阅读Official Google Documentation of API for Android。本指南介绍了适用于 Android 的 Google Places 中的功能,并向您展示如何配置您的应用程序以使用 API。

Android 版 Google Places API 的主要入口点是 PlacePicker UI 小部件、Autocomplete UI 小部件、GeoDataApi 和 PlaceDetectionApi。

使用适用于 Android 的 Google API,您可以构建位置感知应用,根据上下文响应本地企业和设备附近的其他地方。这意味着您可以基于对用户有意义的地点构建丰富的应用程序,以补充 [Android 位置服务][6] 提供的直接基于地理的服务,您传递一个通用搜索词,Google 地图将尝试查找您指定的与您的条件相匹配的纬度/经度附近的位置。如果未指定位置,Google 地图将尝试查找附近的列表。例如:

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

// Search for restaurants in San Francisco
Uri gmmIntentUri = Uri.parse("geo:37.7749,-122.4194?q=restaurants");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-21
    • 1970-01-01
    • 1970-01-01
    • 2013-10-17
    • 1970-01-01
    • 1970-01-01
    • 2014-11-18
    • 2014-12-21
    相关资源
    最近更新 更多