Commit 4e6496447734526ac82b304f882cef243646e61f

Authored by Edmar Moretti
1 parent 9bf4c324

Incluida opção para definição de conectores na ferramenta de inserir textos no mapa

admin/js/editormapfile.js
... ... @@ -345,7 +345,7 @@ function montaParametrosTemas(no,dados,redesenha)
345 345 }
346 346 if(!tree.getNodeByProperty("etiquetaMetadados",id))
347 347 {
348   - conteudo = "<span style=cursor:pointer; onclick=\"editorMetadados('"+codigoMap+"','"+codigoLayer+"')\" ><img width='10px' heigth='10px' style=\"position:relative;top:0px\" title='edita metadados' src=\"../imagens/06.png\" /> Editar metadados</span>"
  348 + conteudo = "<span style=cursor:pointer; onclick=\"editorMetadados('"+codigoMap+"','"+codigoLayer+"')\" ><img width='10px' heigth='10px' style=\"position:relative;top:0px\" title='edita metadados' src=\"../imagens/06.png\" /> Editar metaparâmetros</span>"
349 349 var d = {tipo:"etiquetaMetadados",etiquetaMetadados:id,html:conteudo}
350 350 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true);
351 351 tempNode.isLeaf = true;
... ...
classesphp/classe_temas.php
... ... @@ -630,88 +630,93 @@ $wrap - caractere que indica quebra de linha
630 630 switch ($tipo)
631 631 {
632 632 case "GRAFICOPIZZA":
633   - if(!isset($tamanho)){$tamanho = 5;}
634   - $e->set("size",$tamanho);
635   - $pinlayer->setmetadata("tema","Pontos inseridos");
636   - $pinlayer->set("type",MS_LAYER_POINT);
  633 + if(!isset($tamanho)){$tamanho = 5;}
  634 + $e->set("size",$tamanho);
  635 + $pinlayer->setmetadata("tema","Pontos inseridos");
  636 + $pinlayer->set("type",MS_LAYER_POINT);
637 637 break;
638 638 case "POINT";
639   - if ((!isset($marca)) || ($marca=="")){$marca="marca";}
640   - if(!isset($tamanho)){$tamanho = 5;}
641   - $e->set("size",$tamanho);
642   - $e->set("symbolname",$marca);
643   - corE($e,$cor,"color");
644   - $pinlayer->setmetadata("tema","Pontos inseridos");
645   - $pinlayer->set("type",MS_LAYER_POINT);
  639 + if ((!isset($marca)) || ($marca=="")){$marca="marca";}
  640 + if(!isset($tamanho)){$tamanho = 5;}
  641 + $e->set("size",$tamanho);
  642 + $e->set("symbolname",$marca);
  643 + corE($e,$cor,"color");
  644 + $pinlayer->setmetadata("tema","Pontos inseridos");
  645 + $pinlayer->set("type",MS_LAYER_POINT);
646 646 break;
647 647 case "LINE":
648   - if (!isset($marca)){$marca="linha";}
649   - if(!isset($tamanho)){$tamanho = 2;}
650   - $e->set("size",$tamanho);
651   - $e->set("symbolname",$marca);
652   - $pinlayer->setmetadata("tema","Linhas inseridas");
653   - $pinlayer->set("type",MS_LAYER_LINE);
  648 + if (!isset($marca) || $marca == ""){$marca="linha";}
  649 + if(!isset($tamanho)){$tamanho = 2;}
  650 + $e->set("size",$tamanho);
  651 + $e->set("symbolname",$marca);
  652 + if(isset($cor) && $cor != "")
  653 + {corE($e,$cor,"color");}
  654 + if(isset($texto) && $texto != "")
  655 + {$pinlayer->setmetadata("TEMA",$texto);}
  656 + else
  657 + {$pinlayer->setmetadata("tema","Linhas inseridas");}
  658 + $pinlayer->set("type",MS_LAYER_LINE);
654 659 break;
655 660 case "POLYGON":
656   - if (!isset($marca)){$marca="p9";}
657   - if(!isset($tamanho)){$tamanho = 5;}
658   - $e->set("size",$tamanho);
659   - $e->set("symbolname",$marca);
660   - $pinlayer->setmetadata("tema","Poligonos inseridos");
661   - $pinlayer->set("type",MS_LAYER_POLYGON);
662   - $pinlayer->set("opacity","50");
  661 + if (!isset($marca)){$marca="p9";}
  662 + if(!isset($tamanho)){$tamanho = 5;}
  663 + $e->set("size",$tamanho);
  664 + $e->set("symbolname",$marca);
  665 + $pinlayer->setmetadata("tema","Poligonos inseridos");
  666 + $pinlayer->set("type",MS_LAYER_POLYGON);
  667 + $pinlayer->set("opacity","50");
663 668 break;
664 669 case "ANNOTATION":
665   - $c->set("status",MS_DELETE);
666   - $novac = ms_newclassobj($pinlayer);
667   - $label = $novac->label;
668   - if($wrap != "")
669   - {
670   - $label->set("maxlength",1);
671   - $s = "CLASS LABEL WRAP '$wrap' END END";
672   - $novac->updateFromString($s);
673   - }
674   - $label = $novac->label;
675   -
676   - if ($fonte != "bitmap")
677   - {
678   - $label->set("type",MS_TRUETYPE);
679   - $label->set("font",$fonte);
680   - $label->set("size",$tamanho);
681   - }
682   - else
683   - {
684   - $label->set("type",MS_BITMAP);
685   - //$label->set("font",$fonte);
686   - $t = MS_TINY;
687   - if ($tamanho > 5 ){$t = MS_TINY;}
688   - if ($tamanho >= 7 ){$t = MS_SMALL;}
689   - if ($tamanho >= 10 ){$t = MS_MEDIUM;}
690   - if ($tamanho >= 12 ){$t = MS_LARGE;}
691   - if ($tamanho >= 14 ){$t = MS_GIANT;}
692   - $label->set("size",$t);
693   - }
694   - $label->set("angle",$angulo);
695   - corE($label,$fundo,"backgroundcolor");
696   - corE($label,$sombra,"backgroundshadowcolor");
697   - corE($label,$cor,"color");
698   - $label->set("backgroundshadowsizex",$sombrax);
699   - $label->set("backgroundshadowsizey",$sombray);
700   - corE($label,$outlinecolor,"outlinecolor");
701   - corE($label,$shadowcolor,"shadowcolor");
702   - $label->set("shadowsizex",$shadowsizex);
703   - $label->set("shadowsizey",$shadowsizey);
704   - $label->set("force",$force);
705   - $label->set("mindistance",$mindistance);
706   - $label->set("minfeaturesize",$minfeaturesize);
707   - $label->set("offsetx",$offsetx);
708   - $label->set("offsety",$offsety);
709   - $label->set("partials",$partials);
710   - $p = array("MS_AUTO"=>MS_AUTO,"MS_UL"=>MS_UL,"MS_LR"=>MS_LR,"MS_UR"=>MS_UR,"MS_LL"=>MS_LL,"MS_CR"=>MS_CR,"MS_CL"=>MS_CL,"MS_UC"=>MS_UC,"MS_LC"=>MS_LC,"MS_CC"=>MS_CC);
711   - $label->set("position",$p[$position]);
712   - $pinlayer->setmetadata("TEMA",$texto);
713   - $pinlayer->set("type",MS_LAYER_ANNOTATION);
714   - $pinlayer->set("opacity","100");
  670 + $c->set("status",MS_DELETE);
  671 + $novac = ms_newclassobj($pinlayer);
  672 + $label = $novac->label;
  673 + if($wrap != "")
  674 + {
  675 + $label->set("maxlength",1);
  676 + $s = "CLASS LABEL WRAP '$wrap' END END";
  677 + $novac->updateFromString($s);
  678 + }
  679 + $label = $novac->label;
  680 +
  681 + if ($fonte != "bitmap")
  682 + {
  683 + $label->set("type",MS_TRUETYPE);
  684 + $label->set("font",$fonte);
  685 + $label->set("size",$tamanho);
  686 + }
  687 + else
  688 + {
  689 + $label->set("type",MS_BITMAP);
  690 + //$label->set("font",$fonte);
  691 + $t = MS_TINY;
  692 + if ($tamanho > 5 ){$t = MS_TINY;}
  693 + if ($tamanho >= 7 ){$t = MS_SMALL;}
  694 + if ($tamanho >= 10 ){$t = MS_MEDIUM;}
  695 + if ($tamanho >= 12 ){$t = MS_LARGE;}
  696 + if ($tamanho >= 14 ){$t = MS_GIANT;}
  697 + $label->set("size",$t);
  698 + }
  699 + $label->set("angle",$angulo);
  700 + corE($label,$fundo,"backgroundcolor");
  701 + corE($label,$sombra,"backgroundshadowcolor");
  702 + corE($label,$cor,"color");
  703 + $label->set("backgroundshadowsizex",$sombrax);
  704 + $label->set("backgroundshadowsizey",$sombray);
  705 + corE($label,$outlinecolor,"outlinecolor");
  706 + corE($label,$shadowcolor,"shadowcolor");
  707 + $label->set("shadowsizex",$shadowsizex);
  708 + $label->set("shadowsizey",$shadowsizey);
  709 + $label->set("force",$force);
  710 + $label->set("mindistance",$mindistance);
  711 + $label->set("minfeaturesize",$minfeaturesize);
  712 + $label->set("offsetx",$offsetx);
  713 + $label->set("offsety",$offsety);
  714 + $label->set("partials",$partials);
  715 + $p = array("MS_AUTO"=>MS_AUTO,"MS_UL"=>MS_UL,"MS_LR"=>MS_LR,"MS_UR"=>MS_UR,"MS_LL"=>MS_LL,"MS_CR"=>MS_CR,"MS_CL"=>MS_CL,"MS_UC"=>MS_UC,"MS_LC"=>MS_LC,"MS_CC"=>MS_CC);
  716 + $label->set("position",$p[$position]);
  717 + $pinlayer->setmetadata("TEMA",$texto);
  718 + $pinlayer->set("type",MS_LAYER_ANNOTATION);
  719 + $pinlayer->set("opacity","100");
715 720 break;
716 721 }
717 722 }
... ... @@ -719,19 +724,19 @@ $wrap - caractere que indica quebra de linha
719 724 switch ($tipo)
720 725 {
721 726 case "ANNOTATION":
722   - $shp = ms_newshapeobj(MS_SHAPE_POINT);
723   - $texto = str_replace("*","&",$texto);
724   - $texto = str_replace("|",";",$texto);
725   - $shp->set("text",$texto);
  727 + $shp = ms_newshapeobj(MS_SHAPE_POINT);
  728 + $texto = str_replace("*","&",$texto);
  729 + $texto = str_replace("|",";",$texto);
  730 + $shp->set("text",$texto);
726 731 break;
727 732 case "POINT":
728   - $shp = ms_newshapeobj(MS_SHAPE_POINT);
  733 + $shp = ms_newshapeobj(MS_SHAPE_POINT);
729 734 break;
730 735 case "LINE":
731   - $shp = ms_newshapeobj(MS_SHAPE_LINE);
  736 + $shp = ms_newshapeobj(MS_SHAPE_LINE);
732 737 break;
733 738 case "POLYGON":
734   - $shp = ms_newshapeobj(MS_SHAPE_POLYGON);
  739 + $shp = ms_newshapeobj(MS_SHAPE_POLYGON);
735 740 break;
736 741 }
737 742 $lin = ms_newlineobj();
... ...
ferramentas/inseretxt/index.js.php
... ... @@ -50,6 +50,18 @@ i3GEOF.inseretxt = {
50 50 */
51 51 aguarde: "",
52 52 /*
  53 + Variavel: contaPontos
  54 +
  55 + Conta quantos pontos o usuário clicou na adição de um conector
  56 + */
  57 + contaPontos: 0,
  58 + /*
  59 + Variavel: pontoi
  60 +
  61 + Primeiro ponto do conector clicado no mapa em DD
  62 + */
  63 + pontoi: "0,0",
  64 + /*
53 65 Function: inicia
54 66  
55 67 Inicia a ferramenta. É chamado por criaJanelaFlutuante
... ... @@ -128,8 +140,9 @@ i3GEOF.inseretxt = {
128 140 ' <p class="paragrafo" >Texto que será inserido:<br><br>' +
129 141 $inputText("","","i3GEOinseretxttexto","",60,"") +
130 142 ' <br><br>' +
  143 + ' <input class=inputsb style=cursor:pointer type=checkbox id=i3GEOinseretxttextoconector >&nbsp;Insere com conector' +
131 144 ' <div id=i3GEOinseretxtmen1 style="text-align:left;" >'+
132   - ' <p class="paragrafo" >Digite o texto e clique no mapa no ponto de inclus&atilde;o. Para definir os par&acirc;metros de fonte, tamanho, etc, utilize a guia de propriedades. Se o texto contiver acentuação, não use a fonte padrão (bitmap).' +
  145 + ' <p class="paragrafo" >Digite o texto e clique no mapa no ponto de inclus&atilde;o. Para definir os par&acirc;metros de fonte, tamanho, etc, utilize a guia de propriedades. Se o texto contiver acentuação, não use a fonte padrão (bitmap). Ativando o conector, vc dever&aacute; clicar no ponto inicial e final.' +
133 146 ' </div>' +
134 147 ' </div>' +
135 148 ' <div class=guiaobj id="i3GEOinseretxtguia2obj" style="left:1px;display:none;">' +
... ... @@ -151,6 +164,10 @@ i3GEOF.inseretxt = {
151 164 ' <tr><td>Tamanho:</td><td>' +
152 165 $inputText("","","i3GEOinseretxttamanho_i","",2,"8") +
153 166 ' </td></tr>' +
  167 + ' <tr><td>Largura do conector:</td><td>' +
  168 + $inputText("","","i3GEOinseretxttamanho_c","",2,"8") +
  169 + ' </td></tr>' +
  170 +
154 171 ' <tr><td>&nbsp;</td><td></td></tr>' +
155 172 ' <tr><td>&Acirc;ngulo (no caso de linhas pode ser utilizado AUTO ou FOLLOW (segue a linha), nesses casos, a fonte n&atilde;o pode ser do tipo bitmap):</td><td>' +
156 173 $inputText("","","i3GEOinseretxtangulo_i","",4,"0") +
... ... @@ -169,6 +186,10 @@ i3GEOF.inseretxt = {
169 186 $inputText("","","i3GEOinseretxtfrente_i","",11,"0 0 0") +
170 187 ' <img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEOF.inseretxt.corj(\'i3GEOinseretxtfrente_i\')" /></td></tr>' +
171 188 ' <tr><td>&nbsp;</td><td></td></tr>' +
  189 + ' <tr><td>Cor do conector:</td><td>'+
  190 + $inputText("","","i3GEOinseretxtfrente_c","",11,"0 0 0") +
  191 + ' <img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEOF.inseretxt.corj(\'i3GEOinseretxtfrente_c\')" /></td></tr>' +
  192 + ' <tr><td>&nbsp;</td><td></td></tr>' +
172 193 ' <tr><td>Cor da m&aacute;scara de um pixel de entorno:</td><td>' +
173 194 $inputText("","","i3GEOinseretxtmascara_i","",11,"") +
174 195 ' <img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEOF.inseretxt.corj(\'i3GEOinseretxtmascara_i\')" /></td></tr>' +
... ... @@ -180,7 +201,7 @@ i3GEOF.inseretxt = {
180 201 ' <option value="MS_AUTO" >autom&aacute;tico</option>' +
181 202 ' <option value="MS_UL" >superior esquerdo</option>' +
182 203 ' <option value="MS_UC" >superior centro</option>' +
183   - ' <option value="MS_UR" >superior direito</option>' +
  204 + ' <option value="MS_UR" selected >superior direito</option>' +
184 205 ' <option value="MS_CL" >centro esquerdo</option>' +
185 206 ' <option value="MS_CC" >centro</option>' +
186 207 ' <option value="MS_CR" >centro direito</option>' +
... ... @@ -374,7 +395,23 @@ i3GEOF.inseretxt = {
374 395 return;
375 396 }
376 397 else{
377   - i3GEOF.inseretxt.insere(texto);
  398 + if($i("i3GEOinseretxttextoconector").checked){
  399 + if(i3GEOF.inseretxt.contaPontos == 0){
  400 + i3GEOF.inseretxt.contaPontos = 1;
  401 + i3GEOF.inseretxt.pontoi = objposicaocursor.ddx+" "+objposicaocursor.ddy;
  402 + i3GEOF.inseretxt.aguarde.visibility = "hidden";
  403 + alert("Clique no fim do conector");
  404 + return;
  405 + }
  406 + if(i3GEOF.inseretxt.contaPontos == 1){
  407 + i3GEOF.inseretxt.insere(texto);
  408 + i3GEOF.inseretxt.insereConector(i3GEOF.inseretxt.pontoi+" "+objposicaocursor.ddx+" "+objposicaocursor.ddy,texto);
  409 + i3GEOF.inseretxt.contaPontos = 0;
  410 + return;
  411 + }
  412 + }
  413 + else
  414 + {i3GEOF.inseretxt.insere(texto);}
378 415 }
379 416 }
380 417 else{
... ... @@ -424,6 +461,41 @@ i3GEOF.inseretxt = {
424 461 cp = new cpaint();
425 462 cp.set_response_type("JSON");
426 463 cp.call(p,"inserefeature",monta);
  464 + },
  465 + /*
  466 + Function: insereConector
  467 +
  468 + Insere um conector de textos
  469 +
  470 + Veja:
  471 +
  472 + <INSEREFEATURE>
  473 +
  474 + Parametro:
  475 +
  476 + xy {string} - lista de pontos
  477 + */
  478 + insereConector: function(xy,texto){
  479 + var monta,par,p,nometema,temp;
  480 + monta = function(){
  481 + i3GEOF.inseretxt.aguarde.visibility = "hidden";
  482 + i3GEO.atualiza();
  483 + };
  484 + temp = Math.random() + "b";
  485 + temp = temp.split(".");
  486 + nometema = "pin"+temp[1];
  487 + par = i3GEOF.inseretxt.pegaPar();
  488 + par += "&tamanho="+$i("i3GEOinseretxttamanho_c").value;
  489 + par += "&cor="+$i("i3GEOinseretxtfrente_c").value;
  490 + p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+
  491 + "&funcao=inserefeature&"+par+"&pin="+nometema+"&tipo=LINE&texto="+texto+" (conector)&xy="+xy;
  492 + if(par === false){
  493 + i3GEOF.inseretxt.aguarde.visibility = "hidden";
  494 + return;
  495 + }
  496 + cp = new cpaint();
  497 + cp.set_response_type("JSON");
  498 + cp.call(p,"inserefeature",monta);
427 499 }
428 500 };
429 501 <?php error_reporting(0);if(extension_loaded('zlib')){ob_end_flush();}?>
430 502 \ No newline at end of file
... ...
ferramentas/inserexy2/index.js.php
... ... @@ -673,7 +673,7 @@ i3GEOF.inserexy = {
673 673 {xy.push(divs[i].innerHTML);}
674 674 xy = xy.join(" ")
675 675 cp.set_response_type("JSON");
676   - cp.call(g_locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=mostrawkt&xy="+xy,"xy2wkt",mostra);
  676 + cp.call(i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=mostrawkt&xy="+xy,"xy2wkt",mostra);
677 677 }
678 678 catch(e){alert("Erro: "+e);i3GEOF.inserexy.aguarde.visibility = "hidden";}
679 679 }
... ...