Has anyone tried to use the browser to get geo coordinates and then load them into WWWC using ajax by any chance? Is there a graceful way to do this - something other than calling a third party web service ?
What are you trying to do exactly?
It's relatively easy to get Geolocation from browsers - just a few lines of code using the geolocation api. But how accurate that is depends on how the application is accessed.
Also whenever you use the GeoApis the browser prompts for allowing access to it - at least once initially, caches after that but you will get prompted occasionally, so it's not totally transparent.
Assuming that's not a problem, the actual geolocation code on the client is trivial. Here's an example I use on my site to figure out what timezone I'm in and writing that to a file on the server to let people know where I'm at:
$("#btnGetLocation").click(setLocationFile);
function setLocationFile() {
// get geolocation with callback
navigator.geolocation.getCurrentPosition(function (loc) {
var location =
{
offset: new Date().getTimezoneOffset(),
lat: loc.coords.latitude,
long: loc.coords.longitude
}
// post the results to the server
$.post("location.cshtml",
location,
function (location) {
location = JSON.parse(location);
$("#txtPlace").val(location.Place);
$("#txtTimezone").val(location.Timezone);
},
function() {
alert('error');
});
});
}