/**
 *   地图工具条操作统一接口
 * */
function MapToolBar(){}

MapToolBar.init=function(){
	Circle.init();  //地图中画圆形
	FrameSelect.init();  //地图中框选
	Label.init();//地图中监控和路段标注
	Shift.init();//地图中移位
	Translation.init();//地图中平移
};
MapToolBar.getLayerCollection= function(){
	return MapToolBar.layerCollection||{};
}

MapToolBar.setLayerCollection= function(layerConfig){
	if(!MapToolBar.layerCollection) MapToolBar.layerCollection ={};
	MapToolBar.layerCollection = layerConfig;
}
//按钮栏渲染
MapToolBar.initMainToolBar= function(barList){
	var vpMap = top.ditu;
	var mapUrlObj = {};
	var mapName = ['标准', '黑色', '高清']; // 与pcfg.xml地图配置顺序一致
	var mapUrlNameArray = vpMap.mapUseName.split(',');
	for (var i = 0; i < mapUrlNameArray.length; i++) {
		mapUrlObj[mapName[i]] = mapUrlNameArray[i];
	}
	//barList为mainConfig.json中配置的toolbar的json对象
    var btnArr = barList,htmlStr = [],btn_drop = [],layerConfig = {};
      for(var i = 0;i<btnArr.length;i++){
          if(btnArr[i].list && btnArr[i].list.length>0){  //判断toolbar的json对象中是否有 list 数组对象，如：图层按钮
              var dropList = btnArr[i].list,dropStr='<ul class="drop-list layer-list">';  
              for(var j = 0;j<dropList.length;j++){  
                  dropStr += '<li id="'+ (dropList[j].layerId||"") +'" data-bindTabTitle="'+ (dropList[j].bindTabTitle||"") +'"><input type="checkbox" '+ (dropList[j].layerCheck||"") +'/><a class="drop-list-item" id='+dropList[j].itemId +'>'+ dropList[j].layerName +'</a></li>';
                  layerConfig[dropList[j].layerId] = {'check':!!(dropList[j].layerCheck||""),'bindTabTitle':(dropList[j].bindTabTitle||"")}
                  MapToolBar.setLayerCollection(layerConfig);   //加载list中的元素，如：camera:{bindTabTitle:"摄像头",check: true}
              }
              dropStr += '</ul>';
              btn_drop.push(dropStr);
              if(btnArr[i].position && btnArr[i].position == 'right'){
                htmlStr.push('<a id="btn_drop'+ (btn_drop.length-1) +'" class="l-btn btn-fl" onclick="'+ (btnArr[i].clickFun||"") +'">');
              }else{
                htmlStr.push('<a id="btn_drop'+ (btn_drop.length-1) +'" class="l-btn" onclick="'+ (btnArr[i].clickFun||"") +'">');
              }
          }else if(btnArr[i].dropList && btnArr[i].dropList.length>0){  //判断toolbar的json对象中是否有dropList 数组对象，如：标注按钮
              var dropList = btnArr[i].dropList,dropStr='<ul class="drop-list btnList">';
              for(var j = 0;j<dropList.length;j++){
                  dropStr += '<li data-name="'+ (mapUrlObj[dropList[j].btnName]||"") +'" onclick="'+ (dropList[j].clickFun||"") +'">'+
                  '<span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">'+ dropList[j].btnName +'</span>'+
                  '<span class="l-btn-icon '+ dropList[j].iconCls +'"></span></span></li>';
              }
              dropStr += '</ul>';
              btn_drop.push(dropStr);
              if(btnArr[i].position && btnArr[i].position == 'right'){
                htmlStr.push('<a id="btn_drop'+ (btn_drop.length-1) +'" class="l-btn btn-fl" onclick="'+ (btnArr[i].clickFun||"") +'">');
              }else{
                htmlStr.push('<a id="btn_drop'+ (btn_drop.length-1) +'" class="l-btn" onclick="'+ (btnArr[i].clickFun||"") +'">');
              }
          }else{ //toolbar的json对象按钮为单个按钮
            if(btnArr[i].position && btnArr[i].position == 'right'){
              htmlStr.push('<a class="l-btn btn-fl" id="'+ (btnArr[i].iconId || '') +'" onclick="'+ (btnArr[i].clickFun||"") +'">');
            }else{
              htmlStr.push('<a class="l-btn" id="'+ (btnArr[i].iconId || '') +'" onclick="'+ (btnArr[i].clickFun||"") +'">');
            }
          }
    	   htmlStr.push('<span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">'+ btnArr[i].btnName +'</span>');
           htmlStr.push('<span class="l-btn-icon '+ btnArr[i].iconCls +'"></span>');
           htmlStr.push('</span></a>');
      }
      htmlStr = htmlStr.join("");
      $("#topBtn").append(htmlStr).show();
      if(btn_drop.length>0){
          for(var a = 0;a<btn_drop.length;a++){
              $("#btn_drop"+a).append(btn_drop[a]).hover(function(){
                  $(this).find(".drop-list").stop(true,true).slideDown(200);
              },function(){
                  $(this).find(".drop-list").stop(true,true).slideUp(200);
              })
          }
      }
};
//CheckBox点击事件
MapToolBar.initMainToolBarCheckEvent = function(){
	$("#topBtn .layer-list li").click(function(event){
		var checked=$(this).find(':checkbox').prop("checked") ;
    	var id=$(this).attr("id");
    	if(event.target==$(this).find("input").get(0)){
    		checked=!checked;
    	}
    	if(checked){
    		$(this).find(':checkbox').prop("checked",false);
    		if(id=='camera'){  //相机
    			MapAPI.getCameraGraphicsLayer().hide();
    		}
    		// else if(id=='road'){  //路段
    		// 	MapAPI.getRoadGraphicsLayer().hide();
    		// }
    		// else if(id=='frameselect'){  //框选
    		// 	MapAPI.getFrameSelectGraphicsLayer().hide();
    		// }else if(id=='jtjzw'){ // 建筑物
    		// 	MapAPI.getJtjzwGraphicsLayer().hide();
    		// }
			// else if(id=='xj'){
			// 	MapAPI.getXjGraphicsLayer().hide();
			// }
    		else if(id=='nhywjtbz'){ // 标志牌
    			MapAPI.getNhywjtbzGraphicsLayer().hide();
    		}else if(id=='jtbx'){ // 交通标线
    			MapAPI.getJtbxGraphicsLayer().hide();
    		}else if(id=='jthl'){ // 交通护栏
    			MapAPI.getJthlGraphicsLayer().hide();
    		}else if(id=='jtxhd'){ // 交通信号灯
    			MapAPI.getJtxhdGraphicsLayer().hide();
    		}else if(id=='jtydp'){ // 交通诱导屏
    			MapAPI.getJtydpGraphicsLayer().hide();
    		} else if(id=='dc'){
				MapAPI.getJtdcGraphicsLayer().hide();
			}else if(id=='wb'){
				MapAPI.getJtwbGraphicsLayer().hide();
			}else if(id=='ld'){
				MapAPI.getJtldGraphicsLayer().hide();
			}else{
    			MapAPI.getCameraGraphicsLayer().hide();
    		}
    	}else{
    		$(this).find(':checkbox').prop("checked","checked");
    		if(id=='camera'){  //相机
    			MapAPI.getCameraGraphicsLayer().show();
    		}
    		// else if(id=='road'){  //路段
    		// 	MapAPI.getRoadGraphicsLayer().show();
    		// }else if(id=='frameselect'){  //框选
    		// 	MapAPI.getFrameSelectGraphicsLayer().show();
    		// }else if(id=='jtjzw'){ // 建筑物
    		// 	MapAPI.getJtjzwGraphicsLayer().show();
    		// }else if(id=='xj'){
			// 	MapAPI.getXjGraphicsLayer().show();
			// }

    		else if(id=='nhywjtbz'){ // 标志牌
    			MapAPI.getNhywjtbzGraphicsLayer().show();
    		} else if(id=='jtbx'){ // 标志牌
    			MapAPI.getJtbxGraphicsLayer().show();
    		} else if(id=='jthl') { // 交通护栏
    			MapAPI.getJthlGraphicsLayer().show();
    		} else if(id=='jtxhd'){ // 交通信号灯
    			MapAPI.getJtxhdGraphicsLayer().show();
    		} else if(id=='jtydp') { // 交通诱导屏
    			MapAPI.getJtydpGraphicsLayer().show();
    		}else if(id=='dc') { // 交通诱导屏
				MapAPI.getJtdcGraphicsLayer().show();
			}
			else if(id=='wb') { // 交通诱导屏
				MapAPI.getJtwbGraphicsLayer().show();
			}
			else if(id=='ld') { // 交通诱导屏
				MapAPI.getJtldGraphicsLayer().show();
			}else{
    			MapAPI.getCameraGraphicsLayer().show();
    		}
    	}
    	event.stopPropagation();
	});
};

//平移
MapToolBar.moveTo=function(){
	
};
//监控标注
MapToolBar.mapCameraLabel=function(){
	var html= "<div class='bcontent' style='padding-right:20px;'><form class='form-horizontal'>"+
	"<div class='form-group' style='display:none;'><label for='xh' class='col-sm-left control-label'>序号</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='xh'  placeholder='序号'>"+
     " <input type='text' class='form-control' id='videoId'>"+
    "</div></div>"+
	"<div class='form-group'><label for='sxt' class='col-sm-left control-label'>监控名称：</label>"+
    "<div class='col-sm-right' style='position:relative;'>"+
     " <input type='text' class='form-control' value='' id='sxt' readonly  placeholder='监控名称'>"+
     "<div onclick='Label.cameraSearch()' class='sxtd glyphicon glyphicon-plus' style='cursor:pointer;width: 30px;height: 30px;position: absolute;top: 2px;right: -8px; font-size: 18px;'>+</div>"+
    "</div></div>"+
	"<div class='form-group' style='display:none;'><label for='sbbh' class='col-sm-left control-label'>设备编号：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='sbbh'  placeholder='设备编号'>"+
    "</div></div>"+
	"<div class='form-group' style='display:none;'><label for='tdbh' class='col-sm-left control-label'>通道编号：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='tdbh'  placeholder='通道编号'>"+
    "</div></div>"+
    "<div class='form-group'><label for='jd' class='col-sm-left control-label'>标注经度：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='jd' value='${x}' placeholder='标注经度'>"+
    "</div></div>"+
    "<div class='form-group'><label for='wd' class='col-sm-left control-label'>标注维度：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='wd' value='${y}' placeholder='标注维度'>"+
    "</div></div>"+
    "<div class='form-group'><div class='col-sm-2'></div>"+
    "<div class='col-sm-10'>"+
    " <input class='btn btn-default' onclick='Label.confirmCamera()' type='button' value='确认'>"+
     " <input class='btn btn-default' onclick='Label.cancelCamera()'   id='cancelVideoBtn' type='button' value='取消' style='margin-left:34px;'>"+
    "</div></div>"+
    "</form></div>";
	Label.addCameraLabel(html);
};
//路段标注
MapToolBar.mapRoadLabel=function(){
	var html= "<div class='bcontent' style='padding-right:20px;'><form class='form-horizontal'>"+
	"<div class='form-group' style='display:none;'><label for='xh' class='col-sm-left control-label'>序号</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='xh'  placeholder='序号'>"+
    "</div></div>"+
    "<div class='form-group'><label for='sxt' class='col-sm-left control-label'>路段名称：</label>"+
    "<div class='col-sm-right' style='position:relative;'>"+
    " <input type='text' class='form-control' value='' id='roadPart'   placeholder='路段名称'>"+
    "</div></div>"+
	"<div class='form-group'><label for='sxt' class='col-sm-left control-label'>监控名称：</label>"+
    "<div class='col-sm-right' style='position:relative;'>"+
     " <input type='text' class='form-control' value='' id='sxt' readonly  placeholder='监控名称'>"+
     "<div onclick='Label.cameraSearch()' class='sxtd glyphicon glyphicon-plus' style='cursor:pointer;width: 30px;height: 30px;position: absolute;top: 2px;right: -8px; font-size: 18px;'>+</div>"+
    "</div></div>"+
	"<div class='form-group' style='display:none;'><label for='sbbh' class='col-sm-left control-label'>设备编号：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='sbbh'  placeholder='设备编号'>"+
    "</div></div>"+
	"<div class='form-group' style='display:none;'><label for='tdbh' class='col-sm-left control-label'>通道编号：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='tdbh'  placeholder='通道编号'>"+
    "</div></div>"+
    "<div class='form-group'><label for='roadName' class='col-sm-left control-label'>所属路段：</label>"+
    "<div class='col-sm-right' style='position:relative;'>"+
     " <input type='text' class='form-control' value='' id='roadName' readonly  placeholder='所属路段'>"+
     "<div onclick='Label.roadSearch()' class='sxtd glyphicon glyphicon-plus' style='cursor:pointer;width: 30px;height: 30px;position: absolute;top: 2px;right: -8px; font-size: 18px;'>+</div>"+
    "</div></div>"+  
    "<div class='form-group'><label for='position' class='col-sm-left control-label'>坐标：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='position' value='${position}' placeholder='坐标'>"+
    "</div></div>"+
    "<div class='form-group'><div class='col-sm-2'></div>"+
    "<div class='col-sm-10'>"+
    " <input class='btn btn-default' onclick='Label.confirmRoad()' type='button' value='确认'>"+
     " <input class='btn btn-default' onclick='Label.cancelRoad()'   id='cancelVideoBtn' type='button' value='取消' style='margin-left:34px;'>"+
    "</div></div>"+
    "</form></div>";
	Label.addRoadLabel(html);
};
//建筑物标注
MapToolBar.mapJtjzwLabel=function(){
	var html= "<div class='bcontent' style='padding-right:20px;'><form class='form-horizontal'>"+
	"<div class='form-group' style='display:none;'><label for='xh' class='col-sm-left control-label'>序号</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='xh'  placeholder='序号'>"+
    "</div></div>"+
	"<div class='form-group'><label for='sxt' class='col-sm-left control-label'>建筑名称：</label>"+
    "<div class='col-sm-right' style='position:relative;'>"+
     " <input type='text' class='form-control' value='' id='sxt' readonly  placeholder='建筑名称'>"+
     "<div onclick='Label.jtjzwSearch()' class='sxtd glyphicon glyphicon-plus' style='cursor:pointer;width: 30px;height: 30px;position: absolute;top: 2px;right: -8px; font-size: 18px;'>+</div>"+
    "</div></div>"+
	"<div class='form-group' style='display:none;'><label for='jzwbh' class='col-sm-left control-label'>建筑编号：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='jzwbh'  placeholder='建筑编号'>"+
    "</div></div>"+
	//"<div class='form-group' style='display:none;'><label for='tdbh' class='col-sm-left control-label'>通道编号：</label>"+
    //"<div class='col-sm-right'>"+
    // " <input type='text' class='form-control' id='tdbh'  placeholder='通道编号'>"+
   // "</div></div>"+
    "<div class='form-group'><label for='jd' class='col-sm-left control-label'>标注经度：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='jd' value='${x}' placeholder='标注经度'>"+
    "</div></div>"+
    "<div class='form-group'><label for='wd' class='col-sm-left control-label'>标注维度：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='wd' value='${y}' placeholder='标注维度'>"+
    "</div></div>"+
    "<div class='form-group'><div class='col-sm-2'></div>"+
    "<div class='col-sm-10'>"+
    " <input class='btn btn-default' onclick='Label.confirmJtjzw()' type='button' value='确认'>"+
     " <input class='btn btn-default' onclick='Label.cancelJtjzw()'   id='cancelVideoBtn' type='button' value='取消' style='margin-left:34px;'>"+
    "</div></div>"+
    "</form></div>";
	Label.addJtjzwLabel(html);
};

// 标志牌标注
MapToolBar.mapNhywjtbzLabel=function(){
	var html= "<div class='bcontent' style='padding-right:20px;'><form class='form-horizontal'>"+
	"<div class='form-group' style='display:none;'><label for='xh' class='col-sm-left control-label'>序号</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='xh'  placeholder='序号'>"+
    "</div></div>"+
	"<div class='form-group'><label for='sxt' class='col-sm-left control-label'>标志名称：</label>"+
    "<div class='col-sm-right' style='position:relative;'>"+
     " <input type='text' class='form-control' value='' id='sxt' readonly  placeholder='标志名称'>"+
     "<div onclick='Label.nhywjtbzSearch()' class='sxtd glyphicon glyphicon-plus' style='cursor:pointer;width: 30px;height: 30px;position: absolute;top: 2px;right: -8px; font-size: 18px;'>+</div>"+
    "</div></div>"+
	"<div class='form-group' style='display:none;'><label for='bzbh' class='col-sm-left control-label'>标志编号：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='bzbh'  placeholder='标志编号'>"+
    "</div></div>"+
    "<div class='form-group'><label for='jd' class='col-sm-left control-label'>标注经度：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='jd' value='${x}' placeholder='标注经度'>"+
    "</div></div>"+
    "<div class='form-group'><label for='wd' class='col-sm-left control-label'>标注维度：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='wd' value='${y}' placeholder='标注维度'>"+
    "</div></div>"+
    "<div class='form-group'><div class='col-sm-2'></div>"+
    "<div class='col-sm-10'>"+
    " <input class='btn btn-default' onclick='Label.confirmNhywjtbz()' type='button' value='确认'>"+
     " <input class='btn btn-default' onclick='Label.cancelNhywjtbz()'   id='cancelVideoBtn' type='button' value='取消' style='margin-left:34px;'>"+
    "</div></div>"+
    "</form></div>";
	Label.addNhywjtbzLabel(html);
}

MapToolBar.mapjtbxLabel=function(){
	var html= "<div class='bcontent' style='padding-right:20px;'><form class='form-horizontal'>"+
	"<div class='form-group' style='display:none;'><label for='xh' class='col-sm-left control-label'>序号</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='xh'  placeholder='序号'>"+
    "</div></div>"+
	"<div class='form-group'><label for='sxt' class='col-sm-left control-label'>标线名称：</label>"+
    "<div class='col-sm-right' style='position:relative;'>"+
     " <input type='text' class='form-control' value='' id='sxt' readonly  placeholder='标线名称'>"+
     "<div onclick='Label.jtbxSearch()' class='sxtd glyphicon glyphicon-plus' style='cursor:pointer;width: 30px;height: 30px;position: absolute;top: 2px;right: -8px; font-size: 18px;'>+</div>"+
    "</div></div>"+
	"<div class='form-group' style='display:none;'><label for='bzbh' class='col-sm-left control-label'>标线编号：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='bxbh'  placeholder='标线编号'>"+
    "</div></div>"+
    "<div class='form-group'><label for='jd' class='col-sm-left control-label'>标注经度：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='jd' value='${x}' placeholder='标注经度'>"+
    "</div></div>"+
    "<div class='form-group'><label for='wd' class='col-sm-left control-label'>标注维度：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='wd' value='${y}' placeholder='标注维度'>"+
    "</div></div>"+
    "<div class='form-group'><div class='col-sm-2'></div>"+
    "<div class='col-sm-10'>"+
    " <input class='btn btn-default' onclick='Label.confirmJtbx()' type='button' value='确认'>"+
     " <input class='btn btn-default' onclick='Label.cancelJtbx()'   id='cancelVideoBtn' type='button' value='取消' style='margin-left:34px;'>"+
    "</div></div>"+
    "</form></div>";
	Label.addJtbxLabel(html);
}
// 护栏标注
MapToolBar.mapjthlLabel=function(){
	var html= "<div class='bcontent' style='padding-right:20px;'><form class='form-horizontal'>"+
	"<div class='form-group' style='display:none;'><label for='xh' class='col-sm-left control-label'>序号</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='xh'  placeholder='序号'>"+
    "</div></div>"+
	"<div class='form-group'><label for='sxt' class='col-sm-left control-label'>护栏名称：</label>"+
    "<div class='col-sm-right' style='position:relative;'>"+
     " <input type='text' class='form-control' value='' id='sxt' readonly  placeholder='护栏名称'>"+
     "<div onclick='Label.jthlSearch()' class='sxtd glyphicon glyphicon-plus' style='cursor:pointer;width: 30px;height: 30px;position: absolute;top: 2px;right: -8px; font-size: 18px;'>+</div>"+
    "</div></div>"+
	"<div class='form-group' style='display:none;'><label for='bzbh' class='col-sm-left control-label'>护栏编号：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='hlbh'  placeholder='护栏编号'>"+
    "</div></div>"+
    "<div class='form-group'><label for='jd' class='col-sm-left control-label'>标注经度：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='jd' value='${x}' placeholder='标注经度'>"+
    "</div></div>"+
    "<div class='form-group'><label for='wd' class='col-sm-left control-label'>标注维度：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='wd' value='${y}' placeholder='标注维度'>"+
    "</div></div>"+
    "<div class='form-group'><div class='col-sm-2'></div>"+
    "<div class='col-sm-10'>"+
    " <input class='btn btn-default' onclick='Label.confirmJthl()' type='button' value='确认'>"+
     " <input class='btn btn-default' onclick='Label.cancelJthl()'   id='cancelVideoBtn' type='button' value='取消' style='margin-left:34px;'>"+
    "</div></div>"+
    "</form></div>";
	Label.addJthlLabel(html);
}

// 信号灯标注
MapToolBar.mapjtxhdLabel=function(){
	var html= "<div class='bcontent' style='padding-right:20px;'><form class='form-horizontal'>"+
	"<div class='form-group' style='display:none;'><label for='xh' class='col-sm-left control-label'>序号</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='xh'  placeholder='序号'>"+
    "</div></div>"+
	"<div class='form-group'><label for='sxt' class='col-sm-left control-label'>名称：</label>"+
    "<div class='col-sm-right' style='position:relative;'>"+
     " <input type='text' class='form-control' value='' id='sxt' readonly  placeholder='名称'>"+
     "<div onclick='Label.jtxhdSearch()' class='sxtd glyphicon glyphicon-plus' style='cursor:pointer;width: 30px;height: 30px;position: absolute;top: 2px;right: -8px; font-size: 18px;'>+</div>"+
    "</div></div>"+
	"<div class='form-group' style='display:none;'><label for='xhdbh' class='col-sm-left control-label'>信号灯编号：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='xhdbh'  placeholder='信号灯编号'>"+
    "</div></div>"+
    "<div class='form-group'><label for='jd' class='col-sm-left control-label'>标注经度：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='jd' value='${x}' placeholder='标注经度'>"+
    "</div></div>"+
    "<div class='form-group'><label for='wd' class='col-sm-left control-label'>标注维度：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='wd' value='${y}' placeholder='标注维度'>"+
    "</div></div>"+
    "<div class='form-group'><div class='col-sm-2'></div>"+
    "<div class='col-sm-10'>"+
    " <input class='btn btn-default' onclick='Label.confirmJtxhd()' type='button' value='确认'>"+
     " <input class='btn btn-default' onclick='Label.cancelJtxhd()'   id='cancelVideoBtn' type='button' value='取消' style='margin-left:34px;'>"+
    "</div></div>"+
    "</form></div>";
	Label.addJtxhdLabel(html);
}

// 诱导屏标注
MapToolBar.mapjtydpLabel=function(){
	var html= "<div class='bcontent' style='padding-right:20px;'><form class='form-horizontal'>"+
	"<div class='form-group' style='display:none;'><label for='xh' class='col-sm-left control-label'>序号</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='xh'  placeholder='序号'>"+
    "</div></div>"+
	"<div class='form-group'><label for='sxt' class='col-sm-left control-label'>名称：</label>"+
    "<div class='col-sm-right' style='position:relative;'>"+
     " <input type='text' class='form-control' value='' id='sxt' readonly  placeholder='名称'>"+
     "<div onclick='Label.jtydpSearch()' class='sxtd glyphicon glyphicon-plus' style='cursor:pointer;width: 30px;height: 30px;position: absolute;top: 2px;right: -8px; font-size: 18px;'>+</div>"+
    "</div></div>"+
	"<div class='form-group' style='display:none;'><label for='ledbh' class='col-sm-left control-label'>诱导屏编号：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='ledbh'  placeholder='诱导屏编号'>"+
    "</div></div>"+
    "<div class='form-group'><label for='jd' class='col-sm-left control-label'>标注经度：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='jd' value='${x}' placeholder='标注经度'>"+
    "</div></div>"+
    "<div class='form-group'><label for='wd' class='col-sm-left control-label'>标注维度：</label>"+
    "<div class='col-sm-right'>"+
     " <input type='text' class='form-control' id='wd' value='${y}' placeholder='标注维度'>"+
    "</div></div>"+
    "<div class='form-group'><div class='col-sm-2'></div>"+
    "<div class='col-sm-10'>"+
    " <input class='btn btn-default' onclick='Label.confirmJtydp()' type='button' value='确认'>"+
     " <input class='btn btn-default' onclick='Label.cancelJtydp()'   id='cancelVideoBtn' type='button' value='取消' style='margin-left:34px;'>"+
    "</div></div>"+
    "</form></div>";
	Label.addJtydpLabel(html);
}
//地磁标注
MapToolBar.mapjtdcLabel=function(){
	var html= "<div class='bcontent' style='padding-right:20px;'><form class='form-horizontal'>"+
		"<div class='form-group' style='display:none;'><label for='xh' class='col-sm-left control-label'>序号</label>"+
		"<div class='col-sm-right'>"+
		" <input type='text' class='form-control' id='xh'  placeholder='序号'>"+
		"</div></div>"+
		"<div class='form-group'><label for='sxt' class='col-sm-left control-label'>名称：</label>"+
		"<div class='col-sm-right' style='position:relative;'>"+
		" <input type='text' class='form-control' value='' id='sxt' readonly  placeholder='名称'>"+
		"<div onclick='Label.dcSearch(\"GVD\")' class='sxtd glyphicon glyphicon-plus' style='cursor:pointer;width: 30px;height: 30px;position: absolute;top: 2px;right: -8px; font-size: 18px;'>+</div>"+
		"</div></div>"+
		"<div class='form-group' style='display:none;'><label for='id' class='col-sm-left control-label'>编号：</label>"+
		"<div class='col-sm-right'>"+
		" <input type='text' class='form-control' id='id'  placeholder='编号'>"+
		"</div></div>"+
		"<div class='form-group'><label for='jd' class='col-sm-left control-label'>标注经度：</label>"+
		"<div class='col-sm-right'>"+
		" <input type='text' class='form-control' id='jd' value='${x}' placeholder='标注经度'>"+
		"</div></div>"+
		"<div class='form-group'><label for='wd' class='col-sm-left control-label'>标注维度：</label>"+
		"<div class='col-sm-right'>"+
		" <input type='text' class='form-control' id='wd' value='${y}' placeholder='标注维度'>"+
		"</div></div>"+
		"<div class='form-group'><div class='col-sm-2'></div>"+
		"<div class='col-sm-10'>"+
		" <input class='btn btn-default' onclick='Label.confirmdetector(\"GVD\")' type='button' value='确认'>"+
		" <input class='btn btn-default' onclick='Label.canceldetector(\"GVD\")'   id='cancelVideoBtn' type='button' value='取消' style='margin-left:34px;'>"+
		"</div></div>"+
		"</form></div>";
	Label.adddcLabel(html);
}

//微波标注
MapToolBar.mapjtwbLabel=function(){
	var html= "<div class='bcontent' style='padding-right:20px;'><form class='form-horizontal'>"+
		"<div class='form-group' style='display:none;'><label for='xh' class='col-sm-left control-label'>序号</label>"+
		"<div class='col-sm-right'>"+
		" <input type='text' class='form-control' id='xh'  placeholder='序号'>"+
		"</div></div>"+
		"<div class='form-group'><label for='sxt' class='col-sm-left control-label'>名称：</label>"+
		"<div class='col-sm-right' style='position:relative;'>"+
		" <input type='text' class='form-control' value='' id='sxt' readonly  placeholder='名称'>"+
		"<div onclick='Label.wbSearch(\"SMARTSENSOR\")' class='sxtd glyphicon glyphicon-plus' style='cursor:pointer;width: 30px;height: 30px;position: absolute;top: 2px;right: -8px; font-size: 18px;'>+</div>"+
		"</div></div>"+
		"<div class='form-group' style='display:none;'><label for='id' class='col-sm-left control-label'>编号：</label>"+
		"<div class='col-sm-right'>"+
		" <input type='text' class='form-control' id='id'  placeholder='编号'>"+
		"</div></div>"+
		"<div class='form-group'><label for='jd' class='col-sm-left control-label'>标注经度：</label>"+
		"<div class='col-sm-right'>"+
		" <input type='text' class='form-control' id='jd' value='${x}' placeholder='标注经度'>"+
		"</div></div>"+
		"<div class='form-group'><label for='wd' class='col-sm-left control-label'>标注维度：</label>"+
		"<div class='col-sm-right'>"+
		" <input type='text' class='form-control' id='wd' value='${y}' placeholder='标注维度'>"+
		"</div></div>"+
		"<div class='form-group'><div class='col-sm-2'></div>"+
		"<div class='col-sm-10'>"+
		" <input class='btn btn-default' onclick='Label.confirmdetector(\"SMARTSENSOR\")' type='button' value='确认'>"+
		" <input class='btn btn-default' onclick='Label.canceldetector(\"SMARTSENSOR\")'   id='cancelVideoBtn' type='button' value='取消' style='margin-left:34px;'>"+
		"</div></div>"+
		"</form></div>";
	Label.addwbLabel(html);
}





//雷达标注
MapToolBar.mapjtldLabel=function(){
	var html= "<div class='bcontent' style='padding-right:20px;'><form class='form-horizontal'>"+
		"<div class='form-group' style='display:none;'><label for='xh' class='col-sm-left control-label'>序号</label>"+
		"<div class='col-sm-right'>"+
		" <input type='text' class='form-control' id='xh'  placeholder='序号'>"+
		"</div></div>"+
		"<div class='form-group'><label for='sxt' class='col-sm-left control-label'>名称：</label>"+
		"<div class='col-sm-right' style='position:relative;'>"+
		" <input type='text' class='form-control' value='' id='sxt' readonly  placeholder='名称'>"+
		"<div onclick='Label.ldSearch()' class='sxtd glyphicon glyphicon-plus' style='cursor:pointer;width: 30px;height: 30px;position: absolute;top: 2px;right: -8px; font-size: 18px;'>+</div>"+
		"</div></div>"+
		"<div class='form-group' style='display:none;'><label for='id' class='col-sm-left control-label'>编号：</label>"+
		"<div class='col-sm-right'>"+
		" <input type='text' class='form-control' id='id'  placeholder='编号'>"+
		"</div></div>"+
		"<div class='form-group'><label for='jd' class='col-sm-left control-label'>标注经度：</label>"+
		"<div class='col-sm-right'>"+
		" <input type='text' class='form-control' id='jd' value='${x}' placeholder='标注经度'>"+
		"</div></div>"+
		"<div class='form-group'><label for='wd' class='col-sm-left control-label'>标注维度：</label>"+
		"<div class='col-sm-right'>"+
		" <input type='text' class='form-control' id='wd' value='${y}' placeholder='标注维度'>"+
		"</div></div>"+
		"<div class='form-group'><div class='col-sm-2'></div>"+
		"<div class='col-sm-10'>"+
		" <input class='btn btn-default' onclick='Label.confirmld()' type='button' value='确认'>"+
		" <input class='btn btn-default' onclick='Label.cancelld()'   id='cancelVideoBtn' type='button' value='取消' style='margin-left:34px;'>"+
		"</div></div>"+
		"</form></div>";
	Label.addldLabel(html);
}
//移位
MapToolBar.mapPoint=function(){
	if(Shift.mouseDown){
		Shift.mouseDown.remove();
	}
	MapAPI.getMap().disablePan();
	Shift.mouseDown=MapAPI.getMap().on("mouse-down",function(event){
		Shift.moveHandlerFunction(event);
	});
};
//画圆
MapToolBar.mapCircleLabel=function(){
	Circle.drawPolyline();
};
//框选
MapToolBar.frameSelect=function(){
	FrameSelect.drawPolyline();
};

