Is it possible to filter google place picker

*爱你&永不变心* 提交于 2019-12-20 02:47:11

问题


Is it possible to filter the locations google placepicker displays for lets say only supermarkets? Otherwise, how would i best go about creating a view like this?

mGoogleApiClient = new GoogleApiClient
            .Builder(this)
            .addApi(Places.GEO_DATA_API)
            .addApi(Places.PLACE_DETECTION_API)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .build();

 int PLACE_PICKER_REQUEST = 1;
        PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
    try {
        Context context = getApplicationContext();
        startActivityForResult(builder.build(context), PLACE_PICKER_REQUEST);
    }
    catch (Exception e) {

    }

回答1:


This feature is not currently available. You may follow these two open issues for updates:

  • Issue 8484: Filter Place Picker by PlaceType
  • Issue 8565: PlacePicker Customization - Add Place Type Filter to Intent Builder



回答2:


As far as I know, you can't. I tried extend the PlacePicker class, nothing I can override. Place Picker API looks tentative, hope Google will add this feature in the future.




回答3:


You will need to add a place type in your place search, grocery_or_supermarket is one of them.

Source: https://developers.google.com/places/supported_types



来源:https://stackoverflow.com/questions/30780287/is-it-possible-to-filter-google-place-picker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!