1

I want to use satelite view and street view in my addLocation Activity..which method Should I call for satelite view and street view...`

        public void onClick(View v) {
        //    AddLocationActivity.this.mapView.setSatellite(false);
          //  AddLocationActivity.this.mapView.setStreetView(true);
            AddLocationActivity.this.mapView.invalidate();
            AddLocationActivity.this.streetText.setBackgroundColor(getColor(R.color.colorPrimary));
            AddLocationActivity.this.satelliteText.setBackgroundColor(-1);
        }
    });
Whit Waldo
  • 4,806
  • 4
  • 48
  • 70
Ahad Murtaza
  • 71
  • 1
  • 9

2 Answers2

1

Replace this part.

googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL); 

With this.

googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE); 

This will show satellite view.

Jay Rathod
  • 11,131
  • 6
  • 34
  • 58
bhavani
  • 56
  • 1
  • 6
1

If you have added a map to your application or added a MapFragment, setting the initial state of the map can be done by configuring it with passing GoogleMapOptions object with your options specified. You can create a GoogleMapOptions object like this:

GoogleMapOptions options = new GoogleMapOptions();

And then configure it as follows:

options.mapType(GoogleMap.MAP_TYPE_SATELLITE)
    .compassEnabled(false)
    .rotateGesturesEnabled(false)
    .tiltGesturesEnabled(false);

To know more about applying these options when creating a map, please check Configure initial state - Programmatically.

Teyam
  • 7,686
  • 3
  • 15
  • 22