[go: nahoru, domu]

Skip to content

Commit

Permalink
feat: add additional response values to StreetViewUtil (#1235)
Browse files Browse the repository at this point in the history
* fix: added value REQUEST_DENIED to StreetViewUtil

* feat: added remaining enum values

* doc: updated documentation
  • Loading branch information
kikoso committed Oct 20, 2023
1 parent e57a46b commit 46a07e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ The StreetViewUtil class provides functionality to check whether a location is s
StreetViewUtils.fetchStreetViewData(LatLng(8.1425918, 11.5386121), BuildConfig.MAPS_API_KEY)
```

`fetchStreetViewData` will return `NOT_FOUND`, `OK` or `ZERO_RESULTS`, depending on the response.
`fetchStreetViewData` will return `NOT_FOUND`, `OK`, `ZERO_RESULTS` or `REQUEST_DENIED`, depending on the response.

</details>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class StreetViewUtils {
*
* @param latLng Location to check
* @param apiKey Maps API Key
* @return A boolean value specifying if the location is available on Street View or not.
* @return A Status value specifying if the location is available on Street View or not,
* whether the used key is a right one, or any other error.
*/
suspend fun fetchStreetViewData(latLng: LatLng, apiKey: String): Status {
val urlString =
Expand Down Expand Up @@ -82,5 +83,9 @@ data class ResponseStreetView(val status: Status)
enum class Status {
OK,
ZERO_RESULTS,
NOT_FOUND
NOT_FOUND,
REQUEST_DENIED,
OVER_QUERY_LIMIT,
INVALID_REQUEST,
UNKNOWN_ERROR
}

0 comments on commit 46a07e3

Please sign in to comment.