Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display google maps in 2D view?

I have created a custom map styling following this tutorial

https://www.youtube.com/watch?v=sLZxAB1el6w

The issue i am facing now is that i want to display the Map in 2D view rather than the earth 3D view by default i don't want to enable compass using which i believe you can switch between 2 views.

It would be really helpful if you could share any information regarding this.

Thanks

like image 382
Gaurav Sarma Avatar asked Feb 15 '17 16:02

Gaurav Sarma


People also ask

Can you view Google Earth in 2D?

Turn on 3D imageryfeature to choose between 2D and 3D modes. To switch between 3D and 2D buildings: On your computer, open Google Earth.


1 Answers

As far as I know, there is no option to restrict as only 2D view in just one option.

However you can change the settings like this.

GoogleMapOptions options = new GoogleMapOptions();
options.compassEnabled(false);
options.tiltGesturesEnabled(false);
options.rotateGesturesEnabled(false);

MapView mapView = new MapView(context, options);
mapView.getMapAsync(new OnMapReadyCallback() {
  @Override
  public void onMapReady(GoogleMap map) {

  }
});

More options, check out the document https://developers.google.com/android/reference/com/google/android/gms/maps/GoogleMapOptions

like image 194
wf9a5m75 Avatar answered Sep 20 '22 05:09

wf9a5m75