Sample code from Aaron Parecki's presentation on geolocatoin in web and mobile apps.
If you're at a place where Firefox can't geo-locate you from the wifi, then try setting the geo.wifi.uri parameter in about:config to point to the location.json file provided here. This will always return a consistent location from the Javascript geolocation API methods.