scottjehl/iOS-Orientationchange-Fix — Issue #1: Using device orientation on iOS5 causes geolocation lookups for compass calibration
Author: alexgibson
Created: 2012-01-06 14:20:05+00:00
State: open

I've already posted this on the original Gist, but replicated here on the repo as well.

I fear this could be quite dangerous, especially if adopted by a large project that is widely used?

-------------------------------------------

This does work great - very clever solution! My only reservation is that iOS5 uses geolocation for compass calibration the whole time the browser window is open. I'm not sure what effect this has on battery life, but might be worth consideration?

You can enable the status bar icon for this in:

Settings -> Location Services -> System Services -> Status Bar Icon set to On

Edit - perhaps an alternative event could be to use devicemotion instead of deviceorientation? This would mean it does not require a gyroscope (only iPhone 4+), and could be done using just raw accelerometer events.