Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/217.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
谷歌地图如何显示包含特定单词的位置(Android studio)?_Android_Google Maps_Google Api - Fatal编程技术网

谷歌地图如何显示包含特定单词的位置(Android studio)?

谷歌地图如何显示包含特定单词的位置(Android studio)?,android,google-maps,google-api,Android,Google Maps,Google Api,我目前在谷歌地图公司工作,寻找特定的地点 我尝试使用PlaceType,但它只包括一般的词,如餐厅等 我想做一个搜索功能,可以搜索特定的单词或名称的地方 public void showPlaceInformation(LatLng location) { mMap.clear(); if (previous_marker != null) previous_marker.clear(); new NRPlaces.Builder()

我目前在谷歌地图公司工作,寻找特定的地点

我尝试使用PlaceType,但它只包括一般的词,如餐厅等

我想做一个搜索功能,可以搜索特定的单词或名称的地方

public void showPlaceInformation(LatLng location)
{
    mMap.clear();

    if (previous_marker != null)
        previous_marker.clear();

    new NRPlaces.Builder()
            .listener(MainActivity.this)
            .key("Key")
            .latlng(location.latitude, location.longitude)
            .radius(500)
            .type(PlaceType.RESTAURANT)
            .build()
            .execute();
}
代码运行得很好,但PlaceType非常有限。所以我想更改代码以找到特定的位置。

试试这个

new NRPlaces.Builder()
            .listener(MainActivity.this)
            .key("Key")
            .latlng(location.latitude, location.longitude)
            .radius(500)
            .keyword("Restaurant")
            .type(null)
            .build()
            .execute();

您是否尝试过使用setKeyword(“餐厅”),并将设置类型更改为null.type(null)?您能否解释更多细节?