function addMapEditorTool(){
	var controlDrawBox = getControlDrawBox();
	var controlModify = getControlModify();
	
	$("#add-box").toggle(
		function() {			
			if($("#modify-box").hasClass("ui-state-press")){
				$("#modify-box").click();
			}
			
			map.addControl(controlDrawBox);
			map.controls[0].deactivate();			
			$("#add-box").addClass("ui-state-press");
		}, function() {
			map.removeControl(controlDrawBox);
			map.controls[0].activate();
			$("#add-box").removeClass("ui-state-press");
		}
	);
	
	$("#modify-box").toggle(
		function() {
			if($("#add-box").hasClass("ui-state-press")){
				$("#add-box").click();
			}
			
			map.addControl(controlModify);
			controlModify.activate();			
			$("#modify-box").addClass("ui-state-press");
		}, function() {
			controlModify.deactivate();
			map.removeControl(controlModify);
			$("#modify-box").removeClass("ui-state-press");
		}
	);
	
	vector.events.register("afterfeaturemodified", this, afterFeatModified);
}
///Add the editor tools on the title bar
Add the editor tools on the title bar
Add the editor tools on the title bar
function addMapEditorTool(){
	var controlDrawBox = getControlDrawBox();
	var controlModify = getControlModify();
	$("#add-box").toggle(
		function() {			
			if($("#modify-box").hasClass("ui-state-press")){
				$("#modify-box").click();
			}
			map.addControl(controlDrawBox);
			map.controls[0].deactivate();			
			$("#add-box").addClass("ui-state-press");
		}, function() {
			map.removeControl(controlDrawBox);
			map.controls[0].activate();
			$("#add-box").removeClass("ui-state-press");
		}
	);
	$("#modify-box").toggle(
		function() {
			if($("#add-box").hasClass("ui-state-press")){
				$("#add-box").click();
			}
			map.addControl(controlModify);
			controlModify.activate();			
			$("#modify-box").addClass("ui-state-press");
		}, function() {
			controlModify.deactivate();
			map.removeControl(controlModify);
			$("#modify-box").removeClass("ui-state-press");
		}
	);
	vector.events.register("afterfeaturemodified", this, afterFeatModified);
}
function addMapEditorTool ( ) { var controlDrawBox = getControlDrawBox ( ) ; var controlModify = getControlModify ( ) ; $ ( "#add-box" ) . toggle ( function ( ) { if ( $ ( "#modify-box" ) . hasClass ( "ui-state-press" ) ) { $ ( "#modify-box" ) . click ( ) ; } map . addControl ( controlDrawBox ) ; map . controls [ 0 ] . deactivate ( ) ; $ ( "#add-box" ) . addClass ( "ui-state-press" ) ; } , function ( ) { map . removeControl ( controlDrawBox ) ; map . controls [ 0 ] . activate ( ) ; $ ( "#add-box" ) . removeClass ( "ui-state-press" ) ; } ) ; $ ( "#modify-box" ) . toggle ( function ( ) { if ( $ ( "#add-box" ) . hasClass ( "ui-state-press" ) ) { $ ( "#add-box" ) . click ( ) ; } map . addControl ( controlModify ) ; controlModify . activate ( ) ; $ ( "#modify-box" ) . addClass ( "ui-state-press" ) ; } , function ( ) { controlModify . deactivate ( ) ; map . removeControl ( controlModify ) ; $ ( "#modify-box" ) . removeClass ( "ui-state-press" ) ; } ) ; vector . events . register ( "afterfeaturemodified" , this , afterFeatModified ) ; }
Add the editor tools on the title bar
Add the editor tools on the title bar