views:

164

answers:

1

Can anyone see a problem with the following i hope its a simple snag but its driving me mad..

firebug brings up the 'missing : after property id' - I have looked online but cant suss it

any thoughts..?

  navigator.geolocation.getCurrentPosition(function(position){
  var lat = position.coords.latitude;
  var lon = position.coords.longitude;
  var request = {
  request.origin = position.coords.latitude + ',' + position.coords.longitude;,

  travelMode: google.maps.DirectionsTravelMode.DRIVING
  };

});
},function(error){
//use error.code to determine what went wrong
});
+2  A: 
var request = {
  request.origin = position.coords.latitude + ',' + position.coords.longitude;,

  travelMode: google.maps.DirectionsTravelMode.DRIVING
  };

SHOULD BE

// notice the "origin:" 
var request = {
  origin: position.coords.latitude + ',' + position.coords.longitude,

  travelMode: google.maps.DirectionsTravelMode.DRIVING
  };
webdestroya
In short, you have an extra ; in there
Sean Kinsey
Well, that and he has `request.origin = ` inside the request object, which is bad syntax.
webdestroya
cheers guys, works like a dream...i thank you...this has been driving me mad..!
Ade
No problem, just make sure to mark your question as answered
webdestroya