Commit bdcf54175f91d282ece6475575b9c1ba10ddfe4e

Authored by Edmar Moretti
1 parent 58d67676

--no commit message

classesjs/funcoes.js
@@ -1157,9 +1157,9 @@ function ativaClicks(docMapa) @@ -1157,9 +1157,9 @@ function ativaClicks(docMapa)
1157 pontosdistobj.yimg[n] = objposicaocursor.imgy 1157 pontosdistobj.yimg[n] = objposicaocursor.imgy
1158 pontosdistobj.dist[n] = 0; 1158 pontosdistobj.dist[n] = 0;
1159 if (navn) 1159 if (navn)
1160 - {pontosdistobj.linhas[n] = richdraw.renderer.create(richdraw.mode, richdraw.fillColor, richdraw.lineColor, richdraw.lineWidth, objposicaocursor.imgx,objposicaocursor.imgy,objposicaocursor.imgx,objposicaocursor.imgy);} 1160 + {pontosdistobj.linhas[n] = richdraw.renderer.create(richdraw.mode, richdraw.fillColor, richdraw.lineColor, richdraw.lineWidth, pontosdistobj.ximg[n],pontosdistobj.yimg[n],pontosdistobj.ximg[n],pontosdistobj.yimg[n]);}
1161 else 1161 else
1162 - {pontosdistobj.linhas[n] = richdraw.renderer.create(richdraw.mode, richdraw.fillColor, richdraw.lineColor, richdraw.lineWidth, (objposicaocursor.imgx)-(objmapa.w/2),objposicaocursor.imgy,(objposicaocursor.imgx)-(objmapa.w/2),objposicaocursor.imgy);} 1162 + {pontosdistobj.linhas[n] = richdraw.renderer.create(richdraw.mode, richdraw.fillColor, richdraw.lineColor, richdraw.lineWidth, (pontosdistobj.ximg[n])-(objmapa.w/2),pontosdistobj.yimg[n],(pontosdistobj.ximg[n])-(objmapa.w/2),pontosdistobj.yimg[n]);}
1163 if (n > 0) 1163 if (n > 0)
1164 { 1164 {
1165 var d = parseInt(calculadistancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy)); 1165 var d = parseInt(calculadistancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy));
@@ -1167,25 +1167,31 @@ function ativaClicks(docMapa) @@ -1167,25 +1167,31 @@ function ativaClicks(docMapa)
1167 if (navn) 1167 if (navn)
1168 { 1168 {
1169 try 1169 try
1170 - {richdraw.renderer.resize(pontosdistobj.linhas[n-1], pontosdistobj.xtela[n-1], pontosdistobj.ytela[n-1], objposicaocursor.imgx, objposicaocursor.imgy);} 1170 + {richdraw.renderer.resize(pontosdistobj.linhas[n-1], pontosdistobj.xtela[n-1], pontosdistobj.ytela[n-1], pontosdistobj.ximg[n], pontosdistobj.yimg[n]);}
1171 catch(e){window.status="erro ao desenhar a linha";} 1171 catch(e){window.status="erro ao desenhar a linha";}
1172 var dx = Math.pow(((pontosdistobj.xtela[n])*1) - ((pontosdistobj.xtela[n-1])*1),2); 1172 var dx = Math.pow(((pontosdistobj.xtela[n])*1) - ((pontosdistobj.xtela[n-1])*1),2);
1173 var dy = Math.pow(((pontosdistobj.ytela[n])*1) - ((pontosdistobj.ytela[n-1])*1),2); 1173 var dy = Math.pow(((pontosdistobj.ytela[n])*1) - ((pontosdistobj.ytela[n-1])*1),2);
1174 var w = Math.sqrt(dx + dy); 1174 var w = Math.sqrt(dx + dy);
1175 try 1175 try
1176 - {richdraw.renderer.create('circ', '', 'rgb(250,250,250)', richdraw.lineWidth, pontosdistobj.xtela[n-1] - imagemxi,pontosdistobj.ytela[n-1] - imagemyi,w,w);} 1176 + {
  1177 + if($i("pararraios") && $i("pararraios").checked == true )
  1178 + {richdraw.renderer.create('circ', '', 'rgb(250,250,250)', richdraw.lineWidth, pontosdistobj.xtela[n-1] - imagemxi,pontosdistobj.ytela[n-1] - imagemyi,w,w);}
  1179 + }
1177 catch(e){window.status="erro ao desenhar o raio";} 1180 catch(e){window.status="erro ao desenhar o raio";}
1178 } 1181 }
1179 else 1182 else
1180 { 1183 {
1181 try 1184 try
1182 - {richdraw.renderer.resize(pontosdistobj.linhas[n-1], pontosdistobj.xtela[n-1], pontosdistobj.ytela[n-1], (objposicaocursor.imgx)-(objmapa.w/2), objposicaocursor.imgy);} 1185 + {richdraw.renderer.resize(pontosdistobj.linhas[n-1], pontosdistobj.xtela[n-1], pontosdistobj.ytela[n-1], (pontosdistobj.ximg[n])-(objmapa.w/2), pontosdistobj.yimg[n]);}
1183 catch(e){window.status="erro ao desenhar a linha";} 1186 catch(e){window.status="erro ao desenhar a linha";}
1184 var dx = Math.pow(((pontosdistobj.xtela[n])*1) - ((pontosdistobj.xtela[n-1])*1),2); 1187 var dx = Math.pow(((pontosdistobj.xtela[n])*1) - ((pontosdistobj.xtela[n-1])*1),2);
1185 var dy = Math.pow(((pontosdistobj.ytela[n])*1) - ((pontosdistobj.ytela[n-1])*1),2); 1188 var dy = Math.pow(((pontosdistobj.ytela[n])*1) - ((pontosdistobj.ytela[n-1])*1),2);
1186 var w = Math.sqrt(dx + dy); 1189 var w = Math.sqrt(dx + dy);
1187 try 1190 try
1188 - {richdraw.renderer.create('circ', '', 'rgb(250,250,250)', richdraw.lineWidth, pontosdistobj.ximg[n-1]-w,pontosdistobj.yimg[n-1]-w,w*2,w*2);} 1191 + {
  1192 + if($i("pararraios") && $i("pararraios").checked==true )
  1193 + {richdraw.renderer.create('circ', '', 'rgb(250,250,250)', richdraw.lineWidth, pontosdistobj.ximg[n-1]-w,pontosdistobj.yimg[n-1]-w,w*2,w*2);}
  1194 + }
1189 catch(e){window.status="erro ao desenhar o raio";} 1195 catch(e){window.status="erro ao desenhar o raio";}
1190 } 1196 }
1191 } 1197 }
classesjs/iniciamma.js
@@ -1576,11 +1576,14 @@ function Mapa(e,m) @@ -1576,11 +1576,14 @@ function Mapa(e,m)
1576 novoel.style.height="50px"; 1576 novoel.style.height="50px";
1577 novoel.style.border="1px solid black"; 1577 novoel.style.border="1px solid black";
1578 novoel.style.padding="5px"; 1578 novoel.style.padding="5px";
  1579 + novoel.style.textAlign="left";
1579 var calculo = document.createElement("div"); 1580 var calculo = document.createElement("div");
1580 calculo.id = "mostradistancia_calculo"; 1581 calculo.id = "mostradistancia_calculo";
1581 novoel.appendChild(calculo); 1582 novoel.appendChild(calculo);
1582 var divin = document.createElement("div"); 1583 var divin = document.createElement("div");
1583 - divin.innerHTML = "<span style='color:navy;cursor:pointer' onclick='javascript:richdraw.fecha()' >Parar de medir</span>"; 1584 + divin.style.textAlign="left";
  1585 + divin.innerHTML = "<div style='color:navy;cursor:pointer;text-align:left;' onclick='javascript:richdraw.fecha()' >Parar de medir</div>";
  1586 + divin.innerHTML += "<br><span style='color:navy;cursor:pointer;text-align:left;' ><input style='cursor:pointer' type='checkbox' id='pararraios' 'checked' />Raios</span>";
1584 novoel.appendChild(divin); 1587 novoel.appendChild(divin);
1585 document.body.appendChild(novoel); 1588 document.body.appendChild(novoel);
1586 } 1589 }
classesphp/funcoes_gerais.php
@@ -695,10 +695,11 @@ function testaMapa($map_file) @@ -695,10 +695,11 @@ function testaMapa($map_file)
695 $objMapa = ms_newMapObj($map_file); 695 $objMapa = ms_newMapObj($map_file);
696 ms_ResetErrorList(); 696 ms_ResetErrorList();
697 $img = $objMapa->draw(); 697 $img = $objMapa->draw();
  698 + $erros = "";
698 $error = ms_GetErrorObj(); 699 $error = ms_GetErrorObj();
699 while($error && $error->code != MS_NOERR) 700 while($error && $error->code != MS_NOERR)
700 { 701 {
701 - printf("Erro em %s: %s<br>\n", $error->routine, $error->message); 702 + $erros .= " Erro. ".$error->routine." ".$error->message;
702 $error = $error->next(); 703 $error = $error->next();
703 } 704 }
704 $error = ms_GetErrorObj(); 705 $error = ms_GetErrorObj();
@@ -707,7 +708,10 @@ function testaMapa($map_file) @@ -707,7 +708,10 @@ function testaMapa($map_file)
707 $nmf = str_replace(".map","seguranca.map",$map_file); 708 $nmf = str_replace(".map","seguranca.map",$map_file);
708 $objMapa = ms_newMapObj($nmf); 709 $objMapa = ms_newMapObj($nmf);
709 $objMapa->save($map_file); 710 $objMapa->save($map_file);
  711 + return $erros;
710 } 712 }
  713 + else
  714 + {return "ok";}
711 } 715 }
712 /* 716 /*
713 function: desligamargem 717 function: desligamargem
classesphp/mapa_controle.php
@@ -625,8 +625,9 @@ Include: @@ -625,8 +625,9 @@ Include:
625 case "adtema": 625 case "adtema":
626 include("classe_mapa.php"); 626 include("classe_mapa.php");
627 $m = new Mapa($map_file); 627 $m = new Mapa($map_file);
628 - $cp->set_data($m->adicionaTema($temas,$locaplic)); 628 + $m->adicionaTema($temas,$locaplic);
629 $m->salva(); 629 $m->salva();
  630 + $cp->set_data(testaMapa($map_file));
630 break; 631 break;
631 /* 632 /*
632 Property: excluitema 633 Property: excluitema
temas/bioma.map
@@ -6,7 +6,7 @@ LAYER @@ -6,7 +6,7 @@ LAYER
6 STATUS OFF 6 STATUS OFF
7 TEMPLATE "none.htm" 7 TEMPLATE "none.htm"
8 CONNECTIONTYPE postgis 8 CONNECTIONTYPE postgis
9 - CONNECTION "user=geodados password=geodados dbname=geodados host=10.1.1.36 port=5432" 9 + CONNECTION "user=geodadosx password=geodados dbname=geodados host=10.1.1.36 port=5432"
10 DATA "the_geom FROM (select * FROM brasil.brareg1) as foo USING UNIQUE gid USING SRID=4291" 10 DATA "the_geom FROM (select * FROM brasil.brareg1) as foo USING UNIQUE gid USING SRID=4291"
11 METADATA 11 METADATA
12 ITENS "cd_legenda" 12 ITENS "cd_legenda"