如何在Google的新Places SDK客户端中查询“ findCurrentPlace”?我想添加自定义半径并键入搜索附近的地方

时间:2019-03-25 06:02:16

标签: android google-places-api

我正在使用Google的新Places SDK客户端。我想显示x半径和类型= CAFE,BANK等的位置。有什么方法可以实现?

val placesClient = Places.createClient(this)

        val placeFields = arrayListOf(
            Place.Field.NAME,
            Place.Field.LAT_LNG
        )
        val request = FindCurrentPlaceRequest.builder(placeFields).build()
        placesClient.findCurrentPlace(request).addOnSuccessListener { placeResponse ->
            placeResponse.placeLikelihoods.forEach {
                Log.i("Places", String.format("Place '%s' has likelihood: %s",
                    it.place.latLng.toString(),
                    it.place.name
                ))
            }
        }

0 个答案:

没有答案