使用Google附近搜索搜索多种类型的替代方法

时间:2017-05-23 11:24:53

标签: java android google-places-api

由于谷歌弃用他们的"类型"参数在2017年2月,我现在只能使用一个过滤器搜索附近的地方。

https://developers.google.com/places/web-service/search

 StringBuilder sb = new StringBuilder("https://maps.googleapis.com/maps/api/place/nearbysearch/json?");
        sb.append("location=" + mLatitude + "," + mLongitude);

        int radius= numberpicker.getValue();
        radius=radius *1000;
        //Todo: figure out how to support multiple type..........
        sb.append("&radius="+Integer.toString(radius));
        sb.append("&types=" +LocationType1+"|" +LocationType2); //etc etc 
        sb.append("&sensor=true");
        sb.append("&key=AIzaSyDkIa12Y9nXORou_xCnwS09K53kbJabKHo");

最初我打算做这样的事情,但是因为"类型"我不应该弃用除了使用不同类型的多种类型进行搜索之外能够搜索不同的类型吗?

我在这里看到了同样的问题,但那里仍然没有答案。

Getting multiple types using Google Places API now deprecated

0 个答案:

没有答案
相关问题