$(document).ready(function() { var map1 = new AMap.Map("container1", { center: [114.07125, 22.53135], zoom: 18 }); var map2 = new AMap.Map("container2", { center: [116.3105, 39.8652], zoom: 17 }); //获取用户所在城市信息 function showCityInfo(map) { //实例化城市查询类 var citysearch = new AMap.CitySearch(); //自动获取用户IP,返回当前城市 citysearch.getLocalCity(function(status, result) { if (status === 'complete' && result.info === 'OK') { if (result && result.city && result.bounds) { var citybounds = result.bounds; //地图显示当前城市 map.setBounds(citybounds); } } }); } showCityInfo(map1); showCityInfo(map2); let getList = new AJAX_OBJ(AgencyAddress + "contactus/allContact", getSuccess, onUrlError); getList.getRequestData(); function getSuccess(xmlHttp) { let result = eval('(' + xmlHttp.responseText + ')'); if (result.resultCode === "00000000") { var contactInfoHtml = ""; if (result.data.length > 0) { for (var i = 0; i < result.data.length; i++) { contactInfoHtml += "
" + "
" + result.data[i].contactName + "
" + "
" + result.data[i].contactUrl + "
" + "
" + result.data[i].contactPhone + "
" + "
" + result.data[i].contactMailbox + "
" + //"
" + result.data[i].contactQq + "
" + "
"; } contactInfo.innerHTML = contactInfoHtml; } } else { Dreamer.error(result.resultMsg); } } })