StreetView gyroscope functionality

ε祈祈猫儿з 提交于 2019-12-11 01:44:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!