Your phone didn't connect to a WiFi network, but it did scan for them. Then, when you got back on data, the scan information was connected with Google's database of WiFi networks and their locations.
http://www.huffingtonpost.com/2011/04/25/android-map-reveals...