iPhone GPS Support
The iPhone 3G and all subsequently released iPhone models use A-GPS -- or "Assisted GPS" -- which in basic terms accesses an intermediary server when it is not possible to connect directly via satellite -- indoors, for example -- and this server provides the nearest satellite with additional information to make it possible to more accurately determine a users position.
Apple explains that the iPhone 3G and all later models also use "wi-fi hotspots and cellular towers to get the most accurate location fast" when GPS is not the most convenient method of location detection. The iPhone 3GS and later iPhone models additionally have an integrated digital compass to also provide the direction one is facing, which is quite useful when combined with mapping software.
Likewise, with the exception of the original iPhone, iPhone models can provide real-time navigation assistance, too.
http://www.everymac.com/systems/apple/iphone/iphone-faq/iphone-gps-definition-as sisted-gps-how-gps-works-real-time-navigation.html