Skip to content

Commit

Permalink
PUSH
Browse files Browse the repository at this point in the history
  • Loading branch information
Stikki committed May 12, 2014
2 parents 3a1039b + f2aa63d commit 6ab0aef
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/fielddefs/GeoCoder/input.GeoCoder.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,26 @@
callback: function () {
// Init GeoCoder
var geocoder = new google.maps.Geocoder();
var geocoder = new google.maps.Geocoder(),
address = $('[name="m1_customfield[2]"]').val(); // change to smarty name attrribute value
// Marker setup
geocoder.geocode({ 'address' : '{$fielddef->Address()}' }, function(results, status) {
geocoder.geocode({ 'address' : address }, function(results, status) {
if(status === google.maps.GeocoderStatus.OK) {
//console.log(results);
var lat = results[0].geometry.location.lat(),
lng = results[0].geometry.location.lng();
<<<<<<< HEAD
$("#{$actionid}customfield_{$fielddef->GetId()}_lat").val(results[0].geometry.location.lat());
$("#{$actionid}customfield_{$fielddef->GetId()}_lon").val(results[0].geometry.location.lng());
console.log(results[0].geometry.location);
=======
$("#{$actionid}customfield_{$fielddef->GetId()}_lat").val(lat);
$("#{$actionid}customfield_{$fielddef->GetId()}_lon").val(lng);
>>>>>>> f2aa63d2b3007c03feb9ba31a8a28ea88d553cbc
}
});
}
Expand Down

0 comments on commit 6ab0aef

Please sign in to comment.