diff --git a/admin/admin.db b/admin/admin.db
index 3e81308..755bbed 100644
Binary files a/admin/admin.db and b/admin/admin.db differ
diff --git a/classesphp/classe_toponimia.php b/classesphp/classe_toponimia.php
index 91f894b..d1edda9 100644
--- a/classesphp/classe_toponimia.php
+++ b/classesphp/classe_toponimia.php
@@ -177,6 +177,7 @@ Retorno:
error_reporting(0);
if(!$this->layer){return "erro";}
$this->removeToponimia();
+
if (!isset($tipo)){$tipo = "";}
if ($item != "") //o layer nao tem tabela mas tem toponimia
{
@@ -186,7 +187,7 @@ Retorno:
$nomer = nomeRandomico();
$novolayer->set("name",$nomer);
$novolayer->set("group","");
- $novolayer->set("type",MS_LAYER_ANNOTATION);
+ $novolayer->set("type",$this->layer->type);
$nclasses = $novolayer->numclasses;
for ($i=0; $i < $nclasses; ++$i){
$c = $novolayer->getclass($i);
@@ -242,13 +243,15 @@ Retorno:
}
if ($fonte != "bitmap")
{
- $label->set("type",MS_TRUETYPE);
+ //$label->set("type",MS_TRUETYPE);
+ $label->updatefromstring("LABEL TYPE TRUETYPE END");
$label->set("font",$fonte);
$label->set("size",$tamanho);
}
else
{
- $label->set("type",MS_BITMAP);
+ //$label->set("type",MS_BITMAP);
+ $label->updatefromstring("LABEL TYPE BITMAP END");
//$label->set("font",$fonte);
$t = MS_TINY;
if ($tamanho > 5 ){$t = MS_TINY;}
@@ -261,10 +264,10 @@ Retorno:
if($angulo > 0){
$label->set("angle",$angulo);
}
- if($angulo == "AUTO")
- {$label->updatefromstring("LABEL ANGLE AUTO END");}
- if (strtoupper($angulo) == "CURVO" || strtoupper($angulo) == "FOLLOW")
- {
+ if($angulo == "AUTO"){
+ $label->updatefromstring("LABEL ANGLE AUTO END");
+ }
+ if (strtoupper($angulo) == "CURVO" || strtoupper($angulo) == "FOLLOW"){
$label->updatefromstring("LABEL ANGLE FOLLOW END");
}
corE($label,$cor,"color");
diff --git a/ferramentas/editorol/editorol.js b/ferramentas/editorol/editorol.js
index 8f6c96d..740bf00 100755
--- a/ferramentas/editorol/editorol.js
+++ b/ferramentas/editorol/editorol.js
@@ -657,8 +657,8 @@ i3GEO.editorOL =
YAHOO.legendaeditorOL.container.panel.show();
}
},
- captura : function(x,y,tema) {
- var d = 0.1,
+ captura : function(x,y,tema,idunico) {
+ var d = 0.001,
layer = i3geoOL.getLayersByName(tema)[0],
xy = [x,y],
u = layer.getSource().getUrls()[0],
@@ -719,6 +719,9 @@ i3GEO.editorOL =
})
);
f.setId(i3GEO.util.uid());
+ f.setProperties({
+ idUnico : idunico
+ });
c.addFeature(f);
}
};
@@ -800,51 +803,54 @@ i3GEO.editorOL =
},
//TODO verificar se esta funcionando
salvaGeo : function() {
- var geos = i3GEO.desenho.layergrafico.selectedFeatures, n = geos.length, funcaoOK =
- function() {
+ var s = i3GEO.desenho.layergrafico.getSource(),
+ n = i3GEO.editorOL.idsSelecionados.length,
+ funcaoOK = function() {
// verifica se a geometria contem o atributo que indica a coluna ou codigo unico
- if (geos[0].geometry) {
- var registros = "", valorunico = "", nometema = $i("editorOLcomboTemaEditavel").value, key = "", tema, redesenha, p, g =
- i3GEO.editorOL.google2wgs(geos[0].geometry);
- if (nometema == "") {
- return;
- }
- tema = i3GEO.arvoreDeCamadas.pegaTema(nometema, "", "name");
- // o tema contem o indicador de qual e a coluna que contem o identificador unico
- if (geos[0].attributes.registros) {
- registros = geos[0].attributes.registros;
- for (key in registros) {
- if (registros[key] && key == tema.colunaidunico) {
- valorunico = registros[key];
- }
- }
- }
- redesenha = function(retorno) {
- i3GEO.janela.fechaAguarde("aguardeSalvaPonto");
- i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);
- i3GEO.Interface.atualizaTema("", nometema);
- };
- i3GEO.janela.AGUARDEMODAL = true;
- i3GEO.janela.abreAguarde("aguardeSalvaPonto", $trad("adic") + "...");
- i3GEO.janela.AGUARDEMODAL = false;
+ var f = s.getFeatureById(i3GEO.editorOL.idsSelecionados[0]),
+ g = f.getGeometry(),
+ tema = $i("editorOLcomboTemaEditavel").value,
+ redesenha, p, format;
- // cria um novo registro
- if (valorunico == "") {
- p =
- i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid="
- + i3GEO.configura.sid;
- cpJSON.call(p, "foo", redesenha, "&tema=" + nometema + "&wkt=" + g);
- } else {
- // atualiza a geometria
- p =
- i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=atualizaGeometria&g_sid="
- + i3GEO.configura.sid;
- cpJSON.call(p, "foo", redesenha, "&idunico=" + valorunico + "&tema=" + nometema + "&wkt=" + g);
- }
+ g = i3GEO.editorOL.google2wgs(g);
+ format = new ol.format.WKT();
+ f.setGeometry(g);
+
+ if (tema == "") {
+ return;
+ }
+ redesenha = function(retorno) {
+ i3GEO.janela.fechaAguarde("aguardeSalvaPonto");
+ i3GEO.editorOL.removeFeaturesSel();
+ i3GEO.Interface.atualizaTema("", tema);
+ };
+ i3GEO.janela.AGUARDEMODAL = true;
+ i3GEO.janela.abreAguarde("aguardeSalvaPonto", $trad("adic") + "...");
+ i3GEO.janela.AGUARDEMODAL = false;
+
+ // cria um novo registro
+ if(!f.getProperties().idUnico || f.getProperties().idUnico == ""){
+ p = i3GEO.configura.locaplic
+ + "/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid="
+ + i3GEO.configura.sid;
+ cpJSON.call(p, "foo", redesenha, "&tema=" + tema + "&wkt=" + format.writeFeatures([f]));
+ } else {
+ // atualiza a geometria
+ p = i3GEO.configura.locaplic
+ + "/ferramentas/editortema/exec.php?funcao=atualizaGeometria&g_sid="
+ + i3GEO.configura.sid;
+ cpJSON.call(
+ p,
+ "foo",
+ redesenha,
+ "&idunico=" + f.getProperties().idUnico + "&tema=" + tema + "&wkt=" + format.writeFeatures([f])
+ );
}
- }, funcaoCombo = function(obj) {
- $i("editorOLondeComboTemaEditavel").innerHTML = obj.dados;
- }, texto = $trad("stema") + ":
" + f.join(""; } @@ -1458,6 +1471,9 @@ i3GEO.editorOL = + xy[1] + ",\"" + tema.value + + "\"" + + ",\"" + + valorunico + "\")'>edita geometria
") + "