问题
In the official Google Maps application when a user rotates the device, StreetView is rotated. I made a research and didn't find how to enable gyroscope functionality in Google Maps v2 API for StreetView. I can implement this by myself, but maybe there IS such functionality and I just haven't find it?
回答1:
There isn't any built-in features in StreetView to enable this functionality. If you would like to do it by yourself you can check following links:
- Set the camera orientation point of view
- Animate the camera movements
回答2:
It looks like Google recently updated their API to include accelerometer-based tracking in the street view point of view. Try this example on your phone.
From the documentation on Motion tracking on mobile devices:
On devices that support device orientation events, the API offers users the ability to change the Street View point of view based on the movement of the device. Users can look around by moving their devices. This is called motion tracking or device rotation tracking.
More information (like how to disable it) is in that link.
来源:https://stackoverflow.com/questions/29877260/streetview-gyroscope-functionality