few days back i was going to my friend's house but i was not sure about his[my friend] exact location so i used Google maps and didn't closed the Map's tab. On my way to his house when i checked maps i was amazed to see that even without internet my location was getting updated continuously even maps were detecting the direction of my mobile device.Surely it's now an old technology and it didn't amazed me that way but actually i was thinking that what sort of techniques & technology (Programmatically) they are using to access my location and even direction of my device, so fastly?
Assuming you have an iPhone, it has multiple ways to get your location.
If it is connected to the cell towers it can triangulate your location from those towers.
It can also check local Wi-Fi networks for the location.
And lastly, (and to answer your question), it checks with GPS (and other similar hardware) which is part of the chipset that is built in with cell capabilities. (The iPad Wi-Fi + Cellular model has GPS built-in and can use it even without a SIM card plugged-in).
Google Maps downloads and caches the maps from the area you are in when you search something. (You can also download sections of maps for offline use). Google can still ask for location even if you don't have Wi-Fi or cellular reception and the phone will use GPS (and other similar hardware) to get the location.