Skip to content

Commit

Permalink
fix: change overpass variables to constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Wylwi committed Oct 12, 2024
1 parent 82c11b2 commit e11de47
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import java.io.Reader
import okhttp3.OkHttpClient
import okhttp3.Request

/** The URL of the Overpass API interpreter. */
private const val OVERPASS_API_URL: String = "https://overpass-api.de/api/interpreter"
/** The type of format to request from the Overpass API, written in OverpassQL. */
private const val JSON_OVERPASS_FORMAT_TAG = "[out:json]"

/**
* Overpass implementation of the hiking route provider repository.
*
Expand All @@ -14,11 +19,6 @@ import okhttp3.Request
*/
class HikeRoutesRepositoryOverpass(val client: OkHttpClient) : HikeRoutesRepository {

/** The URL of the Overpass API interpreter. */
private val OVERPASS_API_URL: String = "https://overpass-api.de/api/interpreter"
/** The type of format to request from the Overpass API, written in OverpassQL. */
private val JSON_OVERPASS_FORMAT_TAG = "[out:json]"

override fun getRoutes(
bounds: Bounds,
onSuccess: (List<HikeRoute>) -> Unit,
Expand Down Expand Up @@ -58,7 +58,7 @@ class HikeRoutesRepositoryOverpass(val client: OkHttpClient) : HikeRoutesReposit
* @param onSuccess The callback to be called when the routes are successfully fetched.
* @param onFailure The callback to be called when the routes could not be fetched.
*/
inner class OverpassResponseHandler(
private inner class OverpassResponseHandler(
val onSuccess: (List<HikeRoute>) -> Unit,
val onFailure: (Exception) -> Unit
) : okhttp3.Callback {
Expand Down

0 comments on commit e11de47

Please sign in to comment.