

var iconCount = 0;
sis = new MSISSearch();
sp = new MSearchPointPara();
sis.setSISCallbackFunction(soonjCallback);
sp.setCitycode("010");
sp.setDataSet(MSISSearch.PRIVATE);
sp.setKeyword("");
sp.setNumber(20); 
sp. setBatch(1); 
sis.searchByKeyword(sp); 
var editPoints = new Array();
var resultDivInfo = "";
function soonjCallback(data){
	if(data.count > 0){
		var resultLen = data.poilist.length;
		for (var i = 0; i < resultLen; i++) {
			var type = data.poilist[i]["type"];
			if (type == "" || type == "undefined" || type == null) {
				type = "暂无";
			}
			var address = data.poilist[i]["address"];
			if (address == "" || address == "undefined" || address == null) {
				address = "暂无";
			}
			var tel = data.poilist[i]["tel"];
			if (tel == "" || tel == "undefined" || tel == null) {
				tel = "暂无";
			}
			var name = data.poilist[i].name;
			var x = data.poilist[i].x;
			var y = data.poilist[i].y;
			var pointStyle4 = new MStyle();
			pointStyle4.lineColor = 0x00A851;
			pointStyle4.lineSize = 3;
			pointStyle4.fillColor = 0xF6FF00;
			pointStyle4.fillOpacity = 100;
			pointStyle4.labelColor = 0x00ff00;
			pointStyle4.textContent = abcHelperPointInfoHandle(data.poilist[i]);
			var point = new MCustomPointOverlay(new MLatLng(y,x),"http://channel.mapabc.com/bd/apiShow/icon/renda/" + (iconCount + 1) + ".png",pointStyle4,iconCount + 1);
			editPoints.push(point);
			resultDivInfo += "<div class=\"r_info_e\" onMouseOver=\"this.className='r_info_e_xz';\""
			+" onMouseOut=\"this.className = 'r_info_e';\"><p class=\"p_tittle\">"
			+"<a href=\"javascript:void(0);\" onClick=\"javascript:fun('"+ x +"','"
			+ y +"','"+(iconCount + 1)+"');\">"+(iconCount + 1) + "." + name +"</a>"
			+"<span class=\"tuan\">"+ type +"</span></p></div>";
			iconCount++;
		}
	}
	document.getElementById("r_info").innerHTML = resultDivInfo;
	if(editPoints.length >0 )mapObj.drawCustomPoints(editPoints,false);
}

function abcHelperPointInfoHandle(tempData){
	try{
		var type = tempData["type"];
		if (type == "" || type == "undefined" || type == null) {
			type = "暂无";
		}
		var address = tempData["address"];
		if (address == "" || address == "undefined" || address == null) {
			address = "暂无";
		}
		var tel = tempData["tel"];
		if (tel == "" || tel == "undefined" || tel == null) {
			tel = "暂无";
		}
		var name = tempData.name;
		var result ="";
		result += '<font color=\"#ff0000\">'+name+'</font>';
		result += '<br /><font color=\"#ff0000\">驻地：'+type+'</font>';
		result += '<br /><font color=\"#ff0000\">地址：'+address+'</font>';
		result += '<br /><font color=\"#ff0000\">电话：'+tel+'</font>';
	}catch(err){
		alert(err.name + ":" + err.message);
	}
	return result;
}



