Commit 3a14264151265ad1e67db3f60c89cde3bc26026a

Authored by Edmar Moretti
1 parent 6b507d8a

--no commit message

admin/admin.db
No preview for this file type
classesphp/classe_toponimia.php
... ... @@ -177,6 +177,7 @@ Retorno:
177 177 error_reporting(0);
178 178 if(!$this->layer){return "erro";}
179 179 $this->removeToponimia();
  180 +
180 181 if (!isset($tipo)){$tipo = "";}
181 182 if ($item != "") //o layer nao tem tabela mas tem toponimia
182 183 {
... ... @@ -186,7 +187,7 @@ Retorno:
186 187 $nomer = nomeRandomico();
187 188 $novolayer->set("name",$nomer);
188 189 $novolayer->set("group","");
189   - $novolayer->set("type",MS_LAYER_ANNOTATION);
  190 + $novolayer->set("type",$this->layer->type);
190 191 $nclasses = $novolayer->numclasses;
191 192 for ($i=0; $i < $nclasses; ++$i){
192 193 $c = $novolayer->getclass($i);
... ... @@ -242,13 +243,15 @@ Retorno:
242 243 }
243 244 if ($fonte != "bitmap")
244 245 {
245   - $label->set("type",MS_TRUETYPE);
  246 + //$label->set("type",MS_TRUETYPE);
  247 + $label->updatefromstring("LABEL TYPE TRUETYPE END");
246 248 $label->set("font",$fonte);
247 249 $label->set("size",$tamanho);
248 250 }
249 251 else
250 252 {
251   - $label->set("type",MS_BITMAP);
  253 + //$label->set("type",MS_BITMAP);
  254 + $label->updatefromstring("LABEL TYPE BITMAP END");
252 255 //$label->set("font",$fonte);
253 256 $t = MS_TINY;
254 257 if ($tamanho > 5 ){$t = MS_TINY;}
... ... @@ -261,10 +264,10 @@ Retorno:
261 264 if($angulo > 0){
262 265 $label->set("angle",$angulo);
263 266 }
264   - if($angulo == "AUTO")
265   - {$label->updatefromstring("LABEL ANGLE AUTO END");}
266   - if (strtoupper($angulo) == "CURVO" || strtoupper($angulo) == "FOLLOW")
267   - {
  267 + if($angulo == "AUTO"){
  268 + $label->updatefromstring("LABEL ANGLE AUTO END");
  269 + }
  270 + if (strtoupper($angulo) == "CURVO" || strtoupper($angulo) == "FOLLOW"){
268 271 $label->updatefromstring("LABEL ANGLE FOLLOW END");
269 272 }
270 273 corE($label,$cor,"color");
... ...
ferramentas/editorol/editorol.js
... ... @@ -657,8 +657,8 @@ i3GEO.editorOL =
657 657 YAHOO.legendaeditorOL.container.panel.show();
658 658 }
659 659 },
660   - captura : function(x,y,tema) {
661   - var d = 0.1,
  660 + captura : function(x,y,tema,idunico) {
  661 + var d = 0.001,
662 662 layer = i3geoOL.getLayersByName(tema)[0],
663 663 xy = [x,y],
664 664 u = layer.getSource().getUrls()[0],
... ... @@ -719,6 +719,9 @@ i3GEO.editorOL =
719 719 })
720 720 );
721 721 f.setId(i3GEO.util.uid());
  722 + f.setProperties({
  723 + idUnico : idunico
  724 + });
722 725 c.addFeature(f);
723 726 }
724 727 };
... ... @@ -800,51 +803,54 @@ i3GEO.editorOL =
800 803 },
801 804 //TODO verificar se esta funcionando
802 805 salvaGeo : function() {
803   - var geos = i3GEO.desenho.layergrafico.selectedFeatures, n = geos.length, funcaoOK =
804   - function() {
  806 + var s = i3GEO.desenho.layergrafico.getSource(),
  807 + n = i3GEO.editorOL.idsSelecionados.length,
  808 + funcaoOK = function() {
805 809 // verifica se a geometria contem o atributo que indica a coluna ou codigo unico
806   - if (geos[0].geometry) {
807   - var registros = "", valorunico = "", nometema = $i("editorOLcomboTemaEditavel").value, key = "", tema, redesenha, p, g =
808   - i3GEO.editorOL.google2wgs(geos[0].geometry);
809   - if (nometema == "") {
810   - return;
811   - }
812   - tema = i3GEO.arvoreDeCamadas.pegaTema(nometema, "", "name");
813   - // o tema contem o indicador de qual e a coluna que contem o identificador unico
814   - if (geos[0].attributes.registros) {
815   - registros = geos[0].attributes.registros;
816   - for (key in registros) {
817   - if (registros[key] && key == tema.colunaidunico) {
818   - valorunico = registros[key];
819   - }
820   - }
821   - }
822   - redesenha = function(retorno) {
823   - i3GEO.janela.fechaAguarde("aguardeSalvaPonto");
824   - i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);
825   - i3GEO.Interface.atualizaTema("", nometema);
826   - };
827   - i3GEO.janela.AGUARDEMODAL = true;
828   - i3GEO.janela.abreAguarde("aguardeSalvaPonto", $trad("adic") + "...");
829   - i3GEO.janela.AGUARDEMODAL = false;
  810 + var f = s.getFeatureById(i3GEO.editorOL.idsSelecionados[0]),
  811 + g = f.getGeometry(),
  812 + tema = $i("editorOLcomboTemaEditavel").value,
  813 + redesenha, p, format;
830 814  
831   - // cria um novo registro
832   - if (valorunico == "") {
833   - p =
834   - i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid="
835   - + i3GEO.configura.sid;
836   - cpJSON.call(p, "foo", redesenha, "&tema=" + nometema + "&wkt=" + g);
837   - } else {
838   - // atualiza a geometria
839   - p =
840   - i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=atualizaGeometria&g_sid="
841   - + i3GEO.configura.sid;
842   - cpJSON.call(p, "foo", redesenha, "&idunico=" + valorunico + "&tema=" + nometema + "&wkt=" + g);
843   - }
  815 + g = i3GEO.editorOL.google2wgs(g);
  816 + format = new ol.format.WKT();
  817 + f.setGeometry(g);
  818 +
  819 + if (tema == "") {
  820 + return;
  821 + }
  822 + redesenha = function(retorno) {
  823 + i3GEO.janela.fechaAguarde("aguardeSalvaPonto");
  824 + i3GEO.editorOL.removeFeaturesSel();
  825 + i3GEO.Interface.atualizaTema("", tema);
  826 + };
  827 + i3GEO.janela.AGUARDEMODAL = true;
  828 + i3GEO.janela.abreAguarde("aguardeSalvaPonto", $trad("adic") + "...");
  829 + i3GEO.janela.AGUARDEMODAL = false;
  830 +
  831 + // cria um novo registro
  832 + if(!f.getProperties().idUnico || f.getProperties().idUnico == ""){
  833 + p = i3GEO.configura.locaplic
  834 + + "/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid="
  835 + + i3GEO.configura.sid;
  836 + cpJSON.call(p, "foo", redesenha, "&tema=" + tema + "&wkt=" + format.writeFeatures([f]));
  837 + } else {
  838 + // atualiza a geometria
  839 + p = i3GEO.configura.locaplic
  840 + + "/ferramentas/editortema/exec.php?funcao=atualizaGeometria&g_sid="
  841 + + i3GEO.configura.sid;
  842 + cpJSON.call(
  843 + p,
  844 + "foo",
  845 + redesenha,
  846 + "&idunico=" + f.getProperties().idUnico + "&tema=" + tema + "&wkt=" + format.writeFeatures([f])
  847 + );
844 848 }
845   - }, funcaoCombo = function(obj) {
846   - $i("editorOLondeComboTemaEditavel").innerHTML = obj.dados;
847   - }, texto = $trad("stema") + ":<br><div id=editorOLondeComboTemaEditavel ></div><br><br>";
  849 + },
  850 + funcaoCombo = function(obj) {
  851 + $i("editorOLondeComboTemaEditavel").innerHTML = obj.dados;
  852 + },
  853 + texto = $trad("stema") + ":<br><div id=editorOLondeComboTemaEditavel ></div><br><br>";
848 854 if (n != 1) {
849 855 i3GEO.janela.tempoMsg($trad("seluma"));
850 856 } else {
... ... @@ -1430,7 +1436,8 @@ i3GEO.editorOL =
1430 1436 url = layer.getSource().getUrls()[0];
1431 1437 xy = evt.target.downPx_;
1432 1438 retorno = function(r){
1433   - var texto = "", lonlattexto, xy, temp, temp1, n, i, f = [], textoN = r.split(":");
  1439 + var valorunico = "", camada, texto = "", lonlattexto, xy, temp, temp1, n, i, f = [], textoN = r.split(":");
  1440 + camada = i3GEO.arvoreDeCamadas.pegaTema(tema.value, "", "name");
1434 1441 xy = evt.feature.getGeometry().getFirstCoordinate();
1435 1442 i3GEO.eventos.cliquePerm.ativo = true;
1436 1443 try {
... ... @@ -1445,8 +1452,14 @@ i3GEO.editorOL =
1445 1452 for (i = 0; i < n; i++) {
1446 1453 temp1 = temp[i].replace(/^\s+/, "");
1447 1454 temp1 = temp1.replace(/\s+$/, "");
1448   - if (temp1 != "")
  1455 + if (temp1 != ""){
  1456 + //verifica se a coluna eh o idunico e pega o valor
  1457 + if(camada.colunaidunico != "" && temp1.split(":")[0].trim() == camada.colunaidunico){
  1458 + valorunico = temp1.split(":")[1].trim();
  1459 + temp1 = "(*) "+temp1;
  1460 + }
1449 1461 f.push(temp1);
  1462 + }
1450 1463 }
1451 1464 texto = "<pre>" + f.join("<br>") + "</pre>";
1452 1465 }
... ... @@ -1458,6 +1471,9 @@ i3GEO.editorOL =
1458 1471 + xy[1]
1459 1472 + ",\""
1460 1473 + tema.value
  1474 + + "\""
  1475 + + ",\""
  1476 + + valorunico
1461 1477 + "\")'>edita geometria</span><br>";
1462 1478 i3GEO.Interface.openlayers.balao("<div style='text-align:left' >" + lonlattexto + texto + "</div>","", xy[0], xy[1], false, false);
1463 1479 i3GEO.eventos.cliquePerm.ativo = false;
... ...