please take a look at Sony PlaceEngine, it will get you the location based on the WiFi signals it can access. The down side is that users have to install the PE client. The up side is that it can be accessed by web sites and/or local apps. There is an online server DB you can query for detailed information, and a local DB option you can query for location estimates when there is no internet. This is used for a bunch of Navigation software, including as a back-up to GPS in Sony's Nav-U units. Also, you can update the placeEngine data yourself (i.e. add new access points).
Option 2 is Apple's CoreLocation - which currently uses a service known as SkyHook. I am sure you can use SkyHook on non-Apple platforms if you wish.
Google's Latitude service uses Gears somehow, and it must be using WiFi, because it's much too accurate to be based only on IP Address. They are probably using the PlaceEngine or Skyhook databases themselves on the back-end...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…