Thinking aloud here.... What if the navigator object offered multiple geolocation-related values, and the user could select which one to provide either globally or on a per-site basis?
For example: .latLong = latitude and longitude within the mininum available error radius .latLongApprox = latitude and longitude within a user-defined error radius .postalCode = the current postal code .municipality = the current town/city (useful? compare Cairo, Egypt and Cairo, Georgia, US) .state = state/canton/etc. .country = country If postalCode, municipality or state is provided, country is always also provided to enable the server to look up the corresponding geographic area. On 2/23/07, Gervase Markham <[EMAIL PROTECTED]> wrote:
Kornel Lesinski wrote: > For some applications location given in format other than lat/long may > be more useful and less privacy-sensitive. The privacy-sensitivity problem can be easily dealt with by reducing the accuracy of the lat/long given. > For example name of the city might be good enough if you order a cab > from a nationwide company. > Postcode would be easiest way to integrate location API with existing > services (especially via userjs/greasemonkey, where using > location->postcode database may be difficult). The problem with suggestions like this is that they require geocoding on the server side. Geocoding services are not always readily available; there's no free, unencumbered implementation I know of. And you need a different database for every country. I guess I don't object to the browser returning this information additionally if it knows it - but lat/long should be the baseline, always-present info. > My proposal is: > > use navigator.getGeolocation instead of window.getLocation to avoid > conflicts with existing functions (window object is a global namespace > in JS) and to avoid confusion with window.location object. I think this is a good idea. > navigator.getGeolocation() would return location with best precision > allowed by default (without asking user every time). If user set in > preferences that every page can get location with 10km precision, that > would be returned. I think it's better to ask every time and remember the precision allowed. I would certainly much prefer to know who knows where I am. Gerv