Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
public class GeocoderAdapter extends BaseAdapter implements Filterable {

private final Context context;
private String baseUrl;
private String accessToken;
private String country;
private String[] countries;
Expand All @@ -54,6 +55,26 @@ public GeocoderAdapter(Context context) {
* Getters and setters
*/

/**
* Get the base url of the API.
*
* @return the base url used as endpoint.
* @since 2.0.0
*/
public String getBaseUrl() {
return baseUrl;
}

/**
* Set the base url of the API.
*
* @param baseUrl base url used as end point
* @since 2.0.0
*/
public void setBaseUrl(String baseUrl) {
this.baseUrl = baseUrl;
}

/**
* Get the access token used with making the Mapbox geocoding API call.
*
Expand Down Expand Up @@ -414,6 +435,9 @@ protected FilterResults performFiltering(CharSequence constraint) {
.setAutocomplete(true);

// Optional params
if (getBaseUrl() != null) {
builder.setBaseUrl(getBaseUrl());
}
if (getCountry() != null) {
builder.setCountry(getCountry());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ public void cancelApiCall() {
* Setters
*/

/**
* Set the base url of the API.
*
* @param baseUrl base url used as end point
* @since 2.0.0
*/
public void setBaseUrl(String baseUrl) {
adapter.setBaseUrl(baseUrl);
}

/**
* You'll need to have a Mapbox access token to use the geocoding API within MAS.
*
Expand Down