[英]How to add place options for mapbox placeautocomplete
PlaceOptions placeOptions=new PlaceOptions() {
@Nullable
@Override
public Point proximity() {
return null;
}
@Nullable
@Override
public String language() {
return null;
}
@Override
public int limit() {
return 0;
}
@Nullable
@Override
public Integer historyCount() {
return null;
}
@Nullable
@Override
public String bbox() {
return null;
}
@Nullable
@Override
public String geocodingTypes() {
return null;
}
@Nullable
@Override
public String country() {
return null;
}
@Nullable
@Override
public List<String> injectedPlaces() {
return null;
}
@Override
public int viewMode() {
return 0;
}
@Override
public int backgroundColor() {
return 0;
}
@Override
public int toolbarColor() {
return 0;
}
@Override
public int statusbarColor() {
return 0;
}
@Nullable
@Override
public String hint() {
return null;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel parcel, int i) {
}
};
Intent intent = new PlaceAutocomplete.IntentBuilder()
.accessToken(R.string.token)
.placeOptions(placeOptions)
.build(this);
startActivityForResult(intent, REQUEST_CODE_AUTOCOMPLETE);
我正在嘗試使用塞爾維亞的自定義語言和國家/地區構建自定義 PlaceAutocomplete。 我收到有關可打包數據的錯誤,但我很長時間都找不到解決方案。 因為我使用 MapBox,所以一切都很簡單,並且有完整的文檔,但是對於 PlaceOptions,他們的網站上沒有任何內容。
Parcelable protocol requires a Parcelable.Creator object called CREATOR on class com.magma.magmataxi.LocationActivity$2
我以為 PlaceOptions.builder.build 可以提供幫助,但我仍然無法解決問題。
你應該使用PlaceOptions.builder()
請參閱https://docs.mapbox.com/android/plugins/examples/global-location-search/ 。
另外,在互聯網上發布您的 Mapbox 令牌時要小心。 它現在“暴露”了,可以被其他人使用。 我現在會輪換您的令牌以確保其安全。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.