diff --git a/lib/fielddefs/GeoCoder/input.GeoCoder.tpl b/lib/fielddefs/GeoCoder/input.GeoCoder.tpl index ef6e1b5..814e32e 100755 --- a/lib/fielddefs/GeoCoder/input.GeoCoder.tpl +++ b/lib/fielddefs/GeoCoder/input.GeoCoder.tpl @@ -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 } }); }