function openDis(){
	//添加鼠标测距
	var myDis = new BMapLib.DistanceTool(baidMap);
	myDis.open();
}

function addMenu(){
	baidubool = true;
	var contextMenu = new BMap.ContextMenu();
	var txtMenuItem =new Array();
	if(usertype =="0" || usertype=="1" || usertype=="2" || usertype=="-1"  || usertype=="10"){ 
		txtMenuItem.push({	
				 text:'添加标注',
				 callback:function(p){
			
								var x_pi = 3.14159265358979324 * 3000.0 / 180.0;
								var lng=p.lng;
								var lat=p.lat;
								var x = lng - 0.0065, y = lat - 0.006;
								var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi);
								var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi);
								lng = z * Math.cos(theta);
								lat = z * Math.sin(theta);
			
				        		$("#addMarkerGroupSelect").show();
		        				addMarkerGroupSelect();
				        		$("#markerName").text(language.tjbz);
				                $("#markerlat").val(lat);
				                $("#markerlng").val(lng);
				                $("#markertitle").val("");
								$("#markerdesc").val("");
								$("#addmarkermsg").text(language.btbnwk);
							    $("#addmarkermsg").css("color","rgb(153, 153, 153)");
								if($("#marker_group_option a").length!=1){
									$("#marker_group_option a").parent().siblings(".marker_group_select_txt").text($(".marker_group_option a").eq(0).text());
						            $("#markerGroupId").val($(".marker_group_option a").eq(0).attr("name"));
					            }
					            $("#markerImagesrc").css("backgroundImage","url(http://mapday.exlive.cn/mi/p/f/2/green.gif)");
					            	                       
					            markerArea=drawMarkerArea(getAreaSWLatlng(lat,lng,500),getAreaNELatLng(lat,lng,500));
								$( "#markerArea" ).slider( "value", 500 );
								
								$("#addMarkerButton").show();
								$("#updateMarkerButton").hide();
								
				                $("#markerContentWin").show();
				                $("#markerContentWin").center();
				      
				 }
				});
			 
	  }
	  
  	  txtMenuItem.push({
			   text:'放大',
			   callback:function(){baidMap.zoomIn()}
			  });
	  txtMenuItem.push({
			   text:'缩小',
			   callback:function(){baidMap.zoomOut()}
			  });
	 for(var i=0; i < txtMenuItem.length; i++){
	  contextMenu.addItem(new BMap.MenuItem(txtMenuItem[i].text,txtMenuItem[i].callback,100));
	  if(i==0 || i==1) {
	   contextMenu.addSeparator();
	  }
	 }
	 baidMap.addContextMenu(contextMenu);
}
var temp=0;
var traffic = new BMap.TrafficLayer();
function addOrDelTra(){
	// 创建交通流量图层实例
	temp = temp+1;
	if(temp>2){
		temp=1;
	}
	if(temp == 1){
		baidMap.addTileLayer(traffic)
	}
	if(temp == 2){
		baidMap.removeTileLayer(traffic)
	}
}