/**
	Declaracion de la ventana para el calculo de poligonales
	@uthor Romanuel Ramon Antunez
**/
 var calculoP;

function VCalcularpoligonal(aFeature){

	
        var myData = mapconfig.CalcularPoliAzimuth(aFeature);
	
	var store = new Ext.data.SimpleStore({
        	fields: [
           		{name: 'no'},
           		{name: 'pb'},
			{name: 'po'},
			{name: 'pbx'},
			{name: 'pby'},
			{name: 'azm'},
			{name: 'dis'},
			{name: 'disa'},],
	});
	
	//Aqui mandar a cargar el arreglo del fichero	
	store.loadData(myData);

	// create the Grid
    	var gridAzimuth = new Ext.grid.GridPanel({
        	store: store,
		height: 200,
        	width: 800,
        	columns: [
            		{id:'no',header: "No", autoWidth: true, sortable: true, dataIndex: 'no'},
            		{header: "Punto Base", autoWidth: true, sortable: true, dataIndex: 'pb'},
        		{header: "Punto Objetivo", autoWidth: true, sortable: true, dataIndex: 'po'},
			{header: "X Pto Base", autoWidth: true, sortable: true, dataIndex: 'pbx'},
			{header: "Y Pto Base", autoWidth: true, sortable: true, dataIndex: 'pby'},
			{header: "Acimut", autoWidth: true, sortable: true, dataIndex: 'azm'},
			{header: "Distancia", autoWidth: true, sortable: true, dataIndex: 'dis'},
			{header: "Distancia Acumulada", autoWidth: true, sortable: true, dataIndex: 'disa'},],
		viewConfig: {
        		forceFit: true
   		 },
        	        	
    	});
	
	
		calculoP = new Ext.Window({
			title: 'C&aacute;lculo de Poligonales',
			renderTo: document.body,
			layout: 'fit',
			width       : 800,
                	height      : 200,
			closeAction :'close',
                	plain       : true,
			items: gridAzimuth,
			listeners: {  close: function(){ 
				if(document.getElementById("map_azimuth"))
					document.getElementById("map_azimuth").innerHTML = "";
			}}
		});		
	
	
	calculoP.show();
}

