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 @@ -29,7 +29,7 @@
* <li><strong>Full screen mode</strong>: will place all the search history, results, and injected
* places into a view which has a width equal to the app width.</li>
* <li><strong>Card view mode</strong>: the place search history, results, and injected places in
* an Android Support Library {@link android.support.v7.widget.CardView}</li>
* into a {@link androidx.cardview.widget.CardView}</li>
* </ul>
*
* @since 0.1.0
Expand Down Expand Up @@ -190,6 +190,16 @@ public abstract class PlaceOptions implements Parcelable {
@Nullable
public abstract String hint();

/**
* Optionally change the base URL of the geocoding request
* to something other then the default Mapbox one.
*
* @return base url of geocoding request
* @since 0.12.0
*/
@Nullable
public abstract String baseUrl();

/**
* Build a new instance of the {@link PlaceOptions} class using this method. It will return the
* {@link Builder} which can be used to customize the users experience.
Expand Down Expand Up @@ -429,6 +439,16 @@ public Builder addInjectedFeature(CarmenFeature carmenFeature) {
*/
public abstract Builder hint(@Nullable String hint);

/**
* Optionally change the base URL of the geocoding request
* to something other then the default Mapbox one.
*
* @param baseUrl base url of geocoding request
* @return this builder instance for chaining options together
* @since 0.12.0
*/
public abstract Builder baseUrl(@Nullable String baseUrl);

abstract PlaceOptions autoBuild();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public void buildGeocodingRequest(String accessToken) {
geocoderBuilder = MapboxGeocoding.builder().autocomplete(true);
geocoderBuilder.accessToken(accessToken);
geocoderBuilder.limit(placeOptions.limit());
if (placeOptions.baseUrl() != null) {
geocoderBuilder.baseUrl(placeOptions.baseUrl());
}

// Proximity
Point proximityPoint = placeOptions.proximity();
Expand Down