cllzor (June 9th, 2013)
jQuery('#listing-find-on-map').click(function(ev) {
jQuery.getJSON( Vantage.ajaxurl, {
action: 'vantage_create_listing_geocode',
address: jQuery('#listing-address').val(),
}, function(response) {
if ( response.formatted_address ) {
jQuery('#listing-address').val(response.formatted_address);
}
jQuery('input[name="lat"]').val(response.coords.lat); // <-- fixed this line
jQuery('input[name="lng"]').val(response.coords.lng); // <-- fixed this line
update_position( response.coords.lat, response.coords.lng, 0 );
} );
});
jQuery('#event-find-on-map').click(function(ev) {
jQuery.getJSON( Vantage.ajaxurl, {
action: 'vantage_create_event_geocode',
address: jQuery('#event-address').val(),
}, function(response) {
if ( response.formatted_address ) {
jQuery('#event-address').val(response.formatted_address);
}
jQuery('input[name="lat"]').val(response.coords.lat); //<-- fixed this line
jQuery('input[name="lng"]').val(response.coords.lng); //<-- fixed this line
update_position( response.coords.lat, response.coords.lng, 0 );
} );
});
cllzor (June 9th, 2013)
joes (June 19th, 2013)
There are currently 1 users browsing this thread. (0 members and 1 guests)