Added AJAX calls to get coordinates