Commit 310b5aeda4405b9451758a4ab0c1a206af0e0d50

Authored by Edmar Moretti
1 parent 8b3f04af

Corrige a opção de salvar atributos no editor de limites

admin/admin.db
No preview for this file type
ferramentas/metaestat/editorlimites.js
1 /* 1 /*
2 - Title: Editor vetorial de limites de regiões do sistema METAESTAT 2 +Title: Editor vetorial de limites de regiões do sistema METAESTAT
3 3
4 - Arquivo: 4 +Arquivo:
5 5
6 - i3geo/ferramentas/metaestat/editorlimites.js 6 +i3geo/ferramentas/metaestat/editorlimites.js
7 7
8 Licenca: 8 Licenca:
9 9
10 GPL2 10 GPL2
11 11
12 - i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet 12 +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet
13 13
14 - Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil  
15 - Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com 14 +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil
  15 +Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com
16 16
17 Esse programa utiliza parcialmente os codigos da aplicacao calculadora de carbono desenvolvido pelo 17 Esse programa utiliza parcialmente os codigos da aplicacao calculadora de carbono desenvolvido pelo
18 IPAM - Instituto de Pesquisa Ambiental da Amazonia 18 IPAM - Instituto de Pesquisa Ambiental da Amazonia
@@ -35,9 +35,9 @@ if(typeof(i3GEOF) === 'undefined'){ @@ -35,9 +35,9 @@ if(typeof(i3GEOF) === 'undefined'){
35 var i3GEOF = {}; 35 var i3GEOF = {};
36 } 36 }
37 /* 37 /*
38 - Classe: i3GEOF.editorlimites 38 +Classe: i3GEOF.editorlimites
39 39
40 - Funções de edição vetorial utilizadas pelo editor de regiões do sistema METAESTAT 40 +Funções de edição vetorial utilizadas pelo editor de regiões do sistema METAESTAT
41 */ 41 */
42 i3GEOF.editorlimites = { 42 i3GEOF.editorlimites = {
43 /** 43 /**
@@ -125,16 +125,16 @@ i3GEOF.editorlimites = { @@ -125,16 +125,16 @@ i3GEOF.editorlimites = {
125 i3GEOF.editorlimites.shapes.push(newShape); 125 i3GEOF.editorlimites.shapes.push(newShape);
126 } 126 }
127 }); 127 });
128 - google.maps.event.addListener(  
129 - i3GEOF.editorlimites.drawingManager,  
130 - 'drawingmode_changed',  
131 - i3GEOF.editorlimites.clearSelection  
132 - );  
133 - google.maps.event.addListener(  
134 - i3GeoMap,  
135 - 'click',  
136 - i3GEOF.editorlimites.clearSelection  
137 - ); 128 + google.maps.event.addListener(
  129 + i3GEOF.editorlimites.drawingManager,
  130 + 'drawingmode_changed',
  131 + i3GEOF.editorlimites.clearSelection
  132 + );
  133 + google.maps.event.addListener(
  134 + i3GeoMap,
  135 + 'click',
  136 + i3GEOF.editorlimites.clearSelection
  137 + );
138 }, 138 },
139 /** 139 /**
140 * Atualiza as camadas do mapa que sao oriundas do sistema METAESTAT 140 * Atualiza as camadas do mapa que sao oriundas do sistema METAESTAT
@@ -236,7 +236,7 @@ i3GEOF.editorlimites = { @@ -236,7 +236,7 @@ i3GEOF.editorlimites = {
236 lista = [], 236 lista = [],
237 n = i3GEOF.editorlimites.shapes.length, 237 n = i3GEOF.editorlimites.shapes.length,
238 tipo = "", 238 tipo = "",
239 - ps,nps,j,p,i; 239 + ps,nps,j,p = {},i;
240 240
241 for(i=0;i<n;i++){ 241 for(i=0;i<n;i++){
242 coordenadas = []; 242 coordenadas = [];
@@ -325,27 +325,13 @@ i3GEOF.editorlimites = { @@ -325,27 +325,13 @@ i3GEOF.editorlimites = {
325 if(temp[i].alias == "wkt"){ 325 if(temp[i].alias == "wkt"){
326 wkt = temp[i].valor; 326 wkt = temp[i].valor;
327 } 327 }
328 - if(temp[i].alias == colunaid){ 328 + if(temp[i].alias == colunaid || temp[i].item == colunaid){
329 valorid = temp[i].valor; 329 valorid = temp[i].valor;
330 } 330 }
331 - if(temp[i].alias == colunanome){ 331 + if(temp[i].alias == colunanome || temp[i].item == colunanome){
332 valornome = temp[i].valor; 332 valornome = temp[i].valor;
333 } 333 }
334 } 334 }
335 - /*  
336 - re = new RegExp("POLYGON \\(\\(", "g");  
337 - wkt = wkt.replace(re,'');  
338 - re = new RegExp("\\)\\)", "g");  
339 - wkt = wkt.replace(re,'');  
340 - re = new RegExp(", ", "g");  
341 - wkt = wkt.replace(re,',');  
342 - wkt = wkt.split(",");  
343 - n = wkt.length;  
344 - for(i=0;i<n;i++){  
345 - j = wkt[i].split(" ");  
346 - pontos.push([j[0],j[1]]);  
347 - }  
348 - */  
349 //objeto do wicket ver pacotes/wicket 335 //objeto do wicket ver pacotes/wicket
350 WicketWkt = new Wkt.Wkt(); 336 WicketWkt = new Wkt.Wkt();
351 //wkt = "MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)), ((20 35, 45 20, 30 5, 10 10, 10 30, 20 35), (30 20, 20 25, 20 15, 30 20)))"; 337 //wkt = "MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)), ((20 35, 45 20, 30 5, 10 10, 10 30, 20 35), (30 20, 20 25, 20 15, 30 20)))";
@@ -509,10 +495,10 @@ i3GEOF.editorlimites = { @@ -509,10 +495,10 @@ i3GEOF.editorlimites = {
509 } 495 }
510 */ 496 */
511 var pol; 497 var pol;
512 - if (Wkt.isArray(obj)) { // Distinguish multigeometries (Arrays) from objects  
513 - for (i in obj) {  
514 - if (obj.hasOwnProperty(i) && !Wkt.isArray(obj[i])) {  
515 - pol = new google.maps.Polygon({ 498 + if (Wkt.isArray(obj)) { // Distinguish multigeometries (Arrays) from objects
  499 + for (i in obj) {
  500 + if (obj.hasOwnProperty(i) && !Wkt.isArray(obj[i])) {
  501 + pol = new google.maps.Polygon({
516 path: obj[i].getPath(), 502 path: obj[i].getPath(),
517 map: i3GeoMap, 503 map: i3GeoMap,
518 fillColor: '#ffff00', 504 fillColor: '#ffff00',
@@ -531,10 +517,10 @@ i3GEOF.editorlimites = { @@ -531,10 +517,10 @@ i3GEOF.editorlimites = {
531 i3GEOF.editorlimites.setSelection(pol); 517 i3GEOF.editorlimites.setSelection(pol);
532 }); 518 });
533 i3GEOF.editorlimites.shapes.push(pol); 519 i3GEOF.editorlimites.shapes.push(pol);
534 - }  
535 - }  
536 - return;  
537 - } 520 + }
  521 + }
  522 + return;
  523 + }
538 if (obj.type === 'polygon' || obj.type === 'linestring'){ 524 if (obj.type === 'polygon' || obj.type === 'linestring'){
539 pol = new google.maps.Polygon({ 525 pol = new google.maps.Polygon({
540 paths: obj.getPaths(), 526 paths: obj.getPaths(),
@@ -913,7 +899,7 @@ i3GEOF.editorlimites = { @@ -913,7 +899,7 @@ i3GEOF.editorlimites = {
913 return ins; 899 return ins;
914 }, 900 },
915 comboVariaveis: function(){ 901 comboVariaveis: function(){
916 - var temp = function(dados){ 902 + var temp = function(dados){
917 var i,n = dados.length, ins = ''; 903 var i,n = dados.length, ins = '';
918 ins += '<p class="paragrafo" >Escolha uma vari&aacute;vel para editar</p>'; 904 ins += '<p class="paragrafo" >Escolha uma vari&aacute;vel para editar</p>';
919 ins += "<select style='box-shadow:0 1px 5px gray;width:200px' onchange='i3GEOF.editorlimites.editarAtributos.comboMedidasVariavel(this)'><option value=''>---</option>"; 905 ins += "<select style='box-shadow:0 1px 5px gray;width:200px' onchange='i3GEOF.editorlimites.editarAtributos.comboMedidasVariavel(this)'><option value=''>---</option>";
@@ -926,7 +912,7 @@ i3GEOF.editorlimites = { @@ -926,7 +912,7 @@ i3GEOF.editorlimites = {
926 i3GEO.php.listaVariavel(temp,"i3geo_metaestat"); 912 i3GEO.php.listaVariavel(temp,"i3geo_metaestat");
927 }, 913 },
928 comboMedidasVariavel: function(comboMedidas){ 914 comboMedidasVariavel: function(comboMedidas){
929 - var temp = function(dados){ 915 + var temp = function(dados){
930 var i,n = dados.length, ins = ''; 916 var i,n = dados.length, ins = '';
931 ins += '<p class="paragrafo" >Escolha uma medida da vari&aacute;vel para editar</p>'; 917 ins += '<p class="paragrafo" >Escolha uma medida da vari&aacute;vel para editar</p>';
932 ins += "<select id='editarAtributosComboMedidas' style='box-shadow:0 1px 5px gray;width:200px' onchange=''><option value=''>---</option>"; 918 ins += "<select id='editarAtributosComboMedidas' style='box-shadow:0 1px 5px gray;width:200px' onchange=''><option value=''>---</option>";