Commit 9963f6811eec79611cbb5e1dd388efe6c8119144
1 parent
42b0c25c
Exists in
master
and in
7 other branches
Correção no campo WKT da ferramenta de conversão wkt2layer. O uso do Mustache es…
…tava inserindo tab e fim de linha no campo textarea
Showing
2 changed files
with
6 additions
and
2 deletions
Show diff stats
ferramentas/wkt2layer/index.js
@@ -45,15 +45,18 @@ i3GEOF.wkt2layer = | @@ -45,15 +45,18 @@ i3GEOF.wkt2layer = | ||
45 | if(i3GEOF.wkt2layer.MUSTACHE == ""){ | 45 | if(i3GEOF.wkt2layer.MUSTACHE == ""){ |
46 | $.get(i3GEO.configura.locaplic + "/ferramentas/wkt2layer/template_mst.html", function(template) { | 46 | $.get(i3GEO.configura.locaplic + "/ferramentas/wkt2layer/template_mst.html", function(template) { |
47 | i3GEOF.wkt2layer.MUSTACHE = template; | 47 | i3GEOF.wkt2layer.MUSTACHE = template; |
48 | - i3GEOF.wkt2layer.inicia(iddiv); | 48 | + i3GEOF.wkt2layer.inicia(iddiv,wkt,texto); |
49 | }); | 49 | }); |
50 | return; | 50 | return; |
51 | } | 51 | } |
52 | $i(iddiv).innerHTML = i3GEOF.wkt2layer.html(wkt,texto); | 52 | $i(iddiv).innerHTML = i3GEOF.wkt2layer.html(wkt,texto); |
53 | + $i("i3GEOFwkt2layerWkt").value = wkt; | ||
54 | + | ||
53 | new YAHOO.widget.Button("i3GEOFwkt2layerShp", { | 55 | new YAHOO.widget.Button("i3GEOFwkt2layerShp", { |
54 | onclick : { | 56 | onclick : { |
55 | fn : function() { | 57 | fn : function() { |
56 | var wkt = $i("i3GEOFwkt2layerWkt").value; | 58 | var wkt = $i("i3GEOFwkt2layerWkt").value; |
59 | + wkt = $.trim(wkt.replace(/[\t\n]+/g,' ')); | ||
57 | if(wkt.length < 5){ | 60 | if(wkt.length < 5){ |
58 | i3GEO.janela.tempoMsg($trad("mensagem",i3GEOF.wkt2layer.dicionario)); | 61 | i3GEO.janela.tempoMsg($trad("mensagem",i3GEOF.wkt2layer.dicionario)); |
59 | } | 62 | } |
@@ -67,6 +70,7 @@ i3GEOF.wkt2layer = | @@ -67,6 +70,7 @@ i3GEOF.wkt2layer = | ||
67 | onclick : { | 70 | onclick : { |
68 | fn : function() { | 71 | fn : function() { |
69 | var wkt = $i("i3GEOFwkt2layerWkt").value; | 72 | var wkt = $i("i3GEOFwkt2layerWkt").value; |
73 | + wkt = $.trim(wkt.replace(/[\t\n]+/g,' ')); | ||
70 | if(wkt.length < 5){ | 74 | if(wkt.length < 5){ |
71 | i3GEO.janela.tempoMsg($trad("mensagem",i3GEOF.wkt2layer.dicionario)); | 75 | i3GEO.janela.tempoMsg($trad("mensagem",i3GEOF.wkt2layer.dicionario)); |
72 | } | 76 | } |
@@ -97,7 +101,6 @@ i3GEOF.wkt2layer = | @@ -97,7 +101,6 @@ i3GEOF.wkt2layer = | ||
97 | */ | 101 | */ |
98 | iniciaJanelaFlutuante : function(wkt,texto) { | 102 | iniciaJanelaFlutuante : function(wkt,texto) { |
99 | var cabecalho, janela, divid, titulo; | 103 | var cabecalho, janela, divid, titulo; |
100 | - | ||
101 | if ($i("i3GEOF.wkt2layer")) { | 104 | if ($i("i3GEOF.wkt2layer")) { |
102 | return; | 105 | return; |
103 | } | 106 | } |
@@ -198,6 +201,7 @@ i3GEOF.wkt2layer = | @@ -198,6 +201,7 @@ i3GEOF.wkt2layer = | ||
198 | }; | 201 | }; |
199 | par = i3GEOF.wkt2layer.pegaPar(); | 202 | par = i3GEOF.wkt2layer.pegaPar(); |
200 | wkt = $i("i3GEOFwkt2layerWkt").value; | 203 | wkt = $i("i3GEOFwkt2layerWkt").value; |
204 | + wkt = $.trim(wkt.replace(/[\t]+/g,' ')); | ||
201 | wkt = wkt.split("\n").join("|"); | 205 | wkt = wkt.split("\n").join("|"); |
202 | p = i3GEO.configura.locaplic+"/ferramentas/wkt2layer/exec.php?g_sid="+i3GEO.configura.sid+ | 206 | p = i3GEO.configura.locaplic+"/ferramentas/wkt2layer/exec.php?g_sid="+i3GEO.configura.sid+ |
203 | "&funcao=shapefile&"+par; | 207 | "&funcao=shapefile&"+par; |