How to change map type from simple to satellite of PlacePicker from Google Places API?

Question

I'm using PlacePicker API in my app and want to change it's map type from simple to satellite.

PlacePicker is an API offered by Google.

Here's how I'm using it:

// Construct an intent for the place picker
                try {
                    PlacePicker.IntentBuilder intentBuilder =
                            new PlacePicker.IntentBuilder();
                    Intent intent = intentBuilder.build(this);
                    // Start the intent by requesting a result,
                    // identified by a request code.
                    startActivityForResult(intent, PLACE_PICKER_REQUEST);

                } catch (GooglePlayServicesRepairableException e) {
                    Snackbar snackbar = Snackbar
                            .make(coordinatorLayout, e.getMessage(), Snackbar.LENGTH_SHORT);
                    snackbar.show();
                    // ...
                } catch (GooglePlayServicesNotAvailableException e) {
                    Snackbar snackbar = Snackbar
                            .make(coordinatorLayout, e.getMessage(), Snackbar.LENGTH_SHORT);
                    snackbar.show();
                    // ...
                }

and then in onActivityResult():

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == PLACE_PICKER_REQUEST
                && resultCode == Activity.RESULT_OK) {

            // The user has selected a place. Extract the name and address.
            final Place place = PlacePicker.getPlace(data, this);

            final CharSequence name = place.getName();
            final CharSequence address = place.getAddress();
            LatLng latLng = place.getLatLng();
            final double lat = latLng.latitude;
            final double lng = latLng.longitude;
            String attributions = PlacePicker.getAttributions(data);
            if (attributions == null) {
                attributions = "";
            }

//            mViewName.setText(name);
//            mViewAddress.setText(address);
//            mViewAttributions.setText(Html.fromHtml(attributions));

        } else {
            super.onActivityResult(requestCode, resultCode, data);
        }
    }

It only shows the simple map type. I want to show satellite type map.

Please let me know how to?


Show source
| java   | android   | google-maps   | android-studio   | google-places-api   2016-11-24 03:11 1 Answers

Answers ( 1 )

  1. 2016-11-25 01:11

    It's not currently possible to change the map type in Place Picker. You can add a feature request on the Place API's public issue tracker.

◀ Go back