And as I stated, you don't have to even connect to a wifi network to use it to acquire a location fix. Every wifi network broadcasts its MAC ID every 100 milliseconds--even if it is secured. That is what is used, combined with received signal strength.
I don't know where you got the idea that is based on IP address, but it is wrong.
BTW: If you think this is complicated you should see the complexity involved with satellite GPS. Much more complex than wifi location services, which pretty much is a brute-force-collected database of GPS coordinates matched to mac id. Not very complicated actually. Certainly not when compared to the physics, both classical and quantum, that goes into satellite GPS.