In ajax based system it is advicable to follow async developement meaning all code which need to work with data returned by the ajax call must added to the respective callback method
var path_data = path + "?q=map/get_data/" + param1 + '/' + param2 + '/' + param3 + '/' + param4 +'/' + param5;
var path_map_center = path + "?q=map/get_center/" + param1;
$.getJSON(path_map_center, function(data) {
var center_lati = data.lati;
var center_longi = data.longi;
//all code that need to work with center_lati and center_longi should be added here
});
// do no put any ode that need to work with center_lati and center_longi should be added here
Still if you are not planning to use the async mode then use the async
option
var path_data = path + "?q=map/get_data/" + param1 + '/' + param2 + '/' + param3 + '/' + param4 + '/' + param5;
var path_map_center = path + "?q=map/get_center/" + param1;
$.ajax({
url: path_map_center,
dataType: 'json',
type: 'GET',
async: false,
success: function (data) {
center_lati = data.lati;
center_longi = data.longi;
}
})