
$('document').ready(function() {
	objMap = new BMap.Map('allmap');
	
	objMap.addControl(new BMap.NavigationControl());  
	var point = new BMap.Point(config.lng, config.lat);     // 创建点坐标
	objMap.centerAndZoom(point, config.zoom);    
	objMap.addControl(new BMap.ScaleControl()); 
	objMap.enableScrollWheelZoom();                     //启用滚轮放大缩小
	var html = '<table border="0" cellspacing="0" cellpadding="0"><tbody><tr><td class="blockleft"><div>' + strBlockName  
		     + '</div></td><td class="blockright">&nbsp;</td></tr></tbody></table>';
	var myOverlay = new DeOverlayC(new BMap.Point(intLng, intLat), html);
	objMap.addOverlay(myOverlay);
	window.MyIcon = {};

	$(".othersearch").bind("click",function() {
		var strKeyWords = $(this).val();
		var strPic = $(this).attr('searchtype');
		if ($(this).attr('checked'))
		{
			//自定义搜索回调数据  
			MyIcon[strPic] = [];
			var options = {
				selectFirstResult : true,
				autoViewport : true,
				onSearchComplete: function(results) {   
					var objMark = {};
					if (local.getStatus() == BMAP_STATUS_SUCCESS) {    
						for (var i = 0; i < results.getCurrentNumPois(); i++) {   
							objMark = results.getPoi(i);
							Draw.addMark(objMark.point, strPic);
						}
					}     
				}
			}; 
			var local = new BMap.LocalSearch(objMap, options);  
			local.searchNearby(strKeyWords, point);
		} else {
			if (typeof strPic == 'undefined') {
				Draw.clearChild();
				return; 
			}
			for(var i=0; i< MyIcon[strPic].length; i++) {
				objMap.removeOverlay(MyIcon[strPic][i]); 
			}
		}
	});
});