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

I use the PlacePicker API in my application and want to change its map type from simple to satellite.

PlacePicker is an API offered by Google.

Here is how I use 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 displays only a simple card type. I want to show a satellite type map.

Please let me know how?

+6
source share
1 answer

It is currently not possible to change the map type in Place Picker. You can add a feature request to a public tracker .

+2
source

Source: https://habr.com/ru/post/1012608/


All Articles