Skip to content

Commit

Permalink
chore: add more region tags to autocomplete address sample (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangela authored Jun 10, 2021
1 parent 924e625 commit 1810144
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ private void startAutocompleteIntent() {
}
// [END maps_solutions_android_autocomplete_intent]

// [START maps_solutions_android_autocomplete_map_ready]
@Override
public void onMapReady(GoogleMap googleMap) {
map = googleMap;
Expand All @@ -187,6 +188,7 @@ public void onMapReady(GoogleMap googleMap) {
map.moveCamera(CameraUpdateFactory.newLatLngZoom(coordinates, 15f));
marker = map.addMarker(new MarkerOptions().position(coordinates));
}
// [END maps_solutions_android_autocomplete_map_ready]

private void fillInAddress(Place place) {
AddressComponents components = place.getAddressComponents();
Expand Down Expand Up @@ -249,6 +251,7 @@ private void fillInAddress(Place place) {
showMap(place);
}

// [START maps_solutions_android_autocomplete_map_add]
private void showMap(Place place) {
coordinates = place.getLatLng();

Expand Down Expand Up @@ -276,6 +279,7 @@ private void showMap(Place place) {
updateMap(coordinates);
}
}
// [END maps_solutions_android_autocomplete_map_add]

private void updateMap(LatLng latLng) {
marker.setPosition(latLng);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@

<!-- A map will be added here programmatically
for visual confirmation of the selected address -->
<!-- [START maps_solutions_android_autocomplete_map_fragment] -->
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:id="@+id/confirmation_map"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

<!-- [END maps_solutions_android_autocomplete_map_fragment] -->

</LinearLayout>

0 comments on commit 1810144

Please sign in to comment.