Skip to content

Commit

Permalink
retrieving lat and lng from locator.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Gallardo committed Apr 17, 2012
1 parent 9c9bf20 commit cfd8119
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion public/javascripts/app/views/location_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ app.views.Location = Backbone.View.extend({
getLocation: function(e){
locator = new Google.Locator;

locator.getAddress(function(address){
locator.getAddress(function(address, latlng){
console.log(address, latlng);
$('#location').html('<div id="location_address">' + address + '</div>');
$('#location_address').val(address);
$('#location').append('<a id="hide_location"><img alt="delete location" src="/images/deletelabel.png"></a>');
Expand Down
5 changes: 3 additions & 2 deletions public/javascripts/locator.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ Google.Locator = function (){
var return_value;
if (status == google.maps.GeocoderStatus.OK) {
if (results[0]) {
return_value = results[0].formatted_address;
address = results[0].formatted_address;
coords = latlng;
}
} else {
return_value = "Geocoder failed due to: " + status;
}
return callback(return_value)
return callback(address, coords)
})
})
};
Expand Down

0 comments on commit cfd8119

Please sign in to comment.