【发布时间】:2017-05-08 10:56:12
【问题描述】:
我在谷歌地图 autocompletePlace 中使用 setBoundsBias 来限制自动完成结果,但结果包含超出范围的地点。 有什么问题?
{
final int PLACE_AUTOCOMPLETE_REQUEST_CODE = 1;
AutocompleteFilter typeFilter = new AutocompleteFilter.Builder()
.setCountry("IR")
.build();
try {
Intent intent =
new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_OVERLAY)
.setBoundsBias(new LatLngBounds(new LatLng(38.051183, 46.211586),
new LatLng(38.132784, 46.392860)))
.setFilter(typeFilter)
.build(MainActivity.this);
startActivityForResult(intent, PLACE_AUTOCOMPLETE_REQUEST_CODE);
overridePendingTransition(R.anim.fadein, R.anim.fadeout);
} catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
e.fillInStackTrace();
}
}
【问题讨论】:
标签: android google-maps google-places-api