You need a direct line of sight with satellites for GPS to work.
Of course, this is almost impossible indoors. Here’s how network location works to my understanding:
Another person outdoors uses GPS to locate themselves. This person has Wi-Fi and Bluetooth enabled and their device can see your home/office network. Google and Apple save this information to their databases. When you request your location indoors, your device sends Wi-Fi information of nearby access points. The servers know approximate location of this Wi-Fi network and can give you your approximate location, though with a large margin of error.
Wow, didn’t know this existed. Thanks a lot!