1

Google Maps android app allows rotating of the map using two fingers. This works on most phones I encountered. However it does not on Samsung Galaxy J3 (low-end phone, no magnetometer).

I assume that without magnetometer, authors of map service thought rotation is useless (I disagree). So my questions are:

  1. Am I correct in assuming that this is by design? Is there a confirmation of this "feature"?
  2. Is there a way to override it and enable rotation anyway?
  3. If not, how to determine from java code (I use MapFragment) whether rotate gesture will work?

To clarify I'm not talking about rotating device (horizontal/vertical), but two finger rotate gesture.

Also I do know about

 map.getUiSettings().setRotateGesturesEnabled(true)`. 

It returns no value and throws no exception and yet rotate gestures are not working.

MateuszL
  • 2,751
  • 25
  • 38
  • Just wanted to say I've discovered this problem too with this device. Sometimes it does rotate in a weird fashion. I think something is definitely wrong with the library or the device. Google's own Google Maps app doesn't work either so I don't think it is something you can fix in code unless there's a magical workaround. – Nublodeveloper Jul 17 '17 at 09:19
  • You are right that it occurs in Google's app as well, though I think this is by (bad) design and not error. Since I can't correct the design, I wish I had method to tell whether rotation will work or not, so I can mitigate – MateuszL Jul 17 '17 at 10:48
  • Well. I've just made it rotate by accident. You can rotate it by using two fingers sideways in the same direction. One finger on top of the other. Like when you do it to change to 3D view, but sideways left or right instead of up and down. Weird as hell. – Nublodeveloper Jul 28 '17 at 08:46

1 Answers1

0

Try this:

SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.maps_fragment);
  GoogleMap map = mapFragment.getMap();
  map.getUiSettings().setRotateGesturesEnabled(true);
Kawal
  • 11
  • 1
  • I already have this code. "It returns no value and throws no exception and yet rotate gestures are not working." – MateuszL Mar 10 '17 at 05:26