You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Offline Search SDK (OfflineSearchEngine class, and etc.)
Address Autofill SDK
Search UI SDK
Android OS version: All
Devices affected: All
Search SDK Version: 1.0.0-beta.39
Included in project Maps SDK, Nav SDK versions if available: Maps 10.9.1
Code examples
val callback = object : SearchCallback {
override fun onResults(results: List<SearchResult>, responseInfo: ResponseInfo) {
val result = results.firstOrNull() ?: return
val address = result.address ?: return
val formatted = address.formattedAddress(SearchAddress.FormatStyle.Long) ?: return
continuation.resume(formatted)
}
override fun onError(e: Exception) {
Timber.tag("MapboxUtil").e(e)
}
}
search(ReverseGeoOptions(coordinates.asPoint, limit = 1), Executors.newSingleThreadExecutor() , callback)
Observed behavior and steps
Geocoding [84.0375137, 28.1715234] and formatting the address with FormatStyle.Long results to:
Lekhnath Kaski District, Gandaki, Nepal
Expected behavior
When it should be:
Lekhnath, Kaski District, Gandaki, Nepal
It is because on fun formattedAddress(style: FormatStyle = FormatStyle.Medium): String?, it omits the separator when the first component on the FormatStyle is HOUSE_NUMBER, but it does not check if the first non-null field is actually HOUSE_NUMBER.
My workaround is to create a custom FormatStyle without HOUSE_NUMBER
The text was updated successfully, but these errors were encountered:
Environment
SearchEngine
class, and etc.)OfflineSearchEngine
class, and etc.)Code examples
Observed behavior and steps
Geocoding
[84.0375137, 28.1715234]
and formatting the address withFormatStyle.Long
results to:Lekhnath Kaski District, Gandaki, Nepal
Expected behavior
When it should be:
Lekhnath, Kaski District, Gandaki, Nepal
It is because on
fun formattedAddress(style: FormatStyle = FormatStyle.Medium): String?
, it omits the separator when the first component on theFormatStyle
isHOUSE_NUMBER
, but it does not check if the first non-null field is actuallyHOUSE_NUMBER
.My workaround is to create a custom FormatStyle without
HOUSE_NUMBER
The text was updated successfully, but these errors were encountered: