Commit 503f6099e7f1be8058536e595f84d47836a2ffe8
1 parent
68bd0095
Exists in
master
and in
7 other branches
Opção que permite salvar as geometrias do editor vetorial em arquivos shapefile e adicionar no mapa
Showing
6 changed files
with
99 additions
and
67 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesjs/classe_barradebotoes.js
@@ -1098,7 +1098,7 @@ i3GEO.barraDeBotoes = { | @@ -1098,7 +1098,7 @@ i3GEO.barraDeBotoes = { | ||
1098 | i3GEO.editorOL.layergrafico = new OpenLayers.Layer.Vector("Edição",{displayInLayerSwitcher:false,visibility:true}); | 1098 | i3GEO.editorOL.layergrafico = new OpenLayers.Layer.Vector("Edição",{displayInLayerSwitcher:false,visibility:true}); |
1099 | i3GEO.editorOL.mapa.addLayers([i3GEO.editorOL.layergrafico]); | 1099 | i3GEO.editorOL.mapa.addLayers([i3GEO.editorOL.layergrafico]); |
1100 | i3GEO.editorOL.criaBotoes(i3GEO.editorOL.botoes); | 1100 | i3GEO.editorOL.criaBotoes(i3GEO.editorOL.botoes); |
1101 | - i3GEO.editorOL.criaJanelaAtivaTema(); | 1101 | + //i3GEO.editorOL.criaJanelaAtivaTema(); |
1102 | //i3GEOOL.inicia(); | 1102 | //i3GEOOL.inicia(); |
1103 | } | 1103 | } |
1104 | } | 1104 | } |
classesjs/classe_interface.js
@@ -719,6 +719,7 @@ i3GEO.Interface = { | @@ -719,6 +719,7 @@ i3GEO.Interface = { | ||
719 | openlayers.ordenaLayers(); | 719 | openlayers.ordenaLayers(); |
720 | openlayers.recalcPar(); | 720 | openlayers.recalcPar(); |
721 | i3GEO.janela.fechaAguarde(); | 721 | i3GEO.janela.fechaAguarde(); |
722 | + openlayers.sobeLayersGraficos(); | ||
722 | }, | 723 | }, |
723 | cria: function(w,h){ | 724 | cria: function(w,h){ |
724 | var f,ins, | 725 | var f,ins, |
@@ -875,6 +876,7 @@ i3GEO.Interface = { | @@ -875,6 +876,7 @@ i3GEO.Interface = { | ||
875 | urlfundo = configura.locaplic+"/classesphp/mapa_openlayers.php?g_sid="+i3GEO.configura.sid+"&layer=&tipolayer=fundo&TIPOIMAGEM="+configura.tipoimagem, | 876 | urlfundo = configura.locaplic+"/classesphp/mapa_openlayers.php?g_sid="+i3GEO.configura.sid+"&layer=&tipolayer=fundo&TIPOIMAGEM="+configura.tipoimagem, |
876 | nlayers = i3GEO.arvoreDeCamadas.CAMADAS.length, | 877 | nlayers = i3GEO.arvoreDeCamadas.CAMADAS.length, |
877 | layer, | 878 | layer, |
879 | + layers, | ||
878 | camada, | 880 | camada, |
879 | urllayer, | 881 | urllayer, |
880 | opcoes, | 882 | opcoes, |
@@ -948,6 +950,19 @@ i3GEO.Interface = { | @@ -948,6 +950,19 @@ i3GEO.Interface = { | ||
948 | try | 950 | try |
949 | {i3geoOL.addLayers(i3GEO.Interface.openlayers.LAYERSADICIONAIS);} | 951 | {i3geoOL.addLayers(i3GEO.Interface.openlayers.LAYERSADICIONAIS);} |
950 | catch(e){} | 952 | catch(e){} |
953 | + // | ||
954 | + //sobe o nível das camadas gráficas | ||
955 | + // | ||
956 | + }, | ||
957 | + sobeLayersGraficos: function(){ | ||
958 | + var nlayers = i3geoOL.getNumLayers(), | ||
959 | + layers = i3geoOL.layers, | ||
960 | + i; | ||
961 | + for(i=0;i<nlayers;i++){ | ||
962 | + if(layers[i].CLASS_NAME == "OpenLayers.Layer.Vector"){ | ||
963 | + i3geoOL.raiseLayer(i3geoOL.layers[i],nlayers); | ||
964 | + } | ||
965 | + } | ||
951 | }, | 966 | }, |
952 | inverteModoTile: function(){ | 967 | inverteModoTile: function(){ |
953 | var nlayers = i3GEO.arvoreDeCamadas.CAMADAS.length, | 968 | var nlayers = i3GEO.arvoreDeCamadas.CAMADAS.length, |
classesphp/classe_analise.php
@@ -2216,18 +2216,26 @@ $locaplic - Localização do I3geo | @@ -2216,18 +2216,26 @@ $locaplic - Localização do I3geo | ||
2216 | 2216 | ||
2217 | $geometrias {Array} - lista de WKT | 2217 | $geometrias {Array} - lista de WKT |
2218 | 2218 | ||
2219 | - $operacao {String} - operação suportada pelo Mapserver, por exemplo, union, intersects, etc | 2219 | + $operacao {String} - operação suportada pelo Mapserver, por exemplo, union, intersects, etc. converteSHP irá converter as geometrias em um tema e adicioná-lo ao mapa |
2220 | + | ||
2221 | + $dir_tmp - Diretório temporário do mapserver. Utilizado apenas se $operacao = "converteSHP" | ||
2222 | + | ||
2223 | + $imgdir - Diretório das imagens do mapa atual. Utilizado apenas se $operacao = "converteSHP" | ||
2220 | 2224 | ||
2221 | Return: | 2225 | Return: |
2222 | 2226 | ||
2223 | {string wkt} | 2227 | {string wkt} |
2224 | */ | 2228 | */ |
2225 | - function aplicaFuncaoListaWKT($geometrias,$operacao){ | 2229 | + function aplicaFuncaoListaWKT($geometrias,$operacao,$dir_tmp="",$imgdir=""){ |
2230 | + if($operacao === "converteSHP"){ | ||
2231 | + $this->incmapageometrias($dir_tmp,$imgdir,$geometrias,$tipoLista="arraywkt"); | ||
2232 | + return "ok"; | ||
2233 | + } | ||
2234 | + | ||
2226 | $geos = array(); | 2235 | $geos = array(); |
2227 | foreach ($geometrias as $geo){ | 2236 | foreach ($geometrias as $geo){ |
2228 | $geos[] = ms_shapeObjFromWkt($geo); | 2237 | $geos[] = ms_shapeObjFromWkt($geo); |
2229 | } | 2238 | } |
2230 | - | ||
2231 | $n = count($geos); | 2239 | $n = count($geos); |
2232 | if ($n == 1) | 2240 | if ($n == 1) |
2233 | { | 2241 | { |
@@ -2397,26 +2405,37 @@ $dir_tmp - Diretório temporário do mapserver | @@ -2397,26 +2405,37 @@ $dir_tmp - Diretório temporário do mapserver | ||
2397 | $imgdir - Diretório das imagens do mapa atual | 2405 | $imgdir - Diretório das imagens do mapa atual |
2398 | 2406 | ||
2399 | $lista - Nomes, sem o caminho, dos arquivos com as geometrias, separados por vírgula. | 2407 | $lista - Nomes, sem o caminho, dos arquivos com as geometrias, separados por vírgula. |
2408 | + | ||
2409 | +$tipoLista - tipo de valores que são passados em $lista stringArquivos|arraywkt. O default é stringArquivos | ||
2400 | */ | 2410 | */ |
2401 | - function incmapageometrias($dir_tmp,$imgdir,$lista) | 2411 | + function incmapageometrias($dir_tmp,$imgdir,$lista,$tipoLista="stringArquivos") |
2402 | { | 2412 | { |
2403 | - $lista = explode(",",$lista); | ||
2404 | $dir = $dir_tmp."/".$imgdir."/"; | 2413 | $dir = $dir_tmp."/".$imgdir."/"; |
2405 | - $shapes = array(); | ||
2406 | - $valoresoriginais = array(); | ||
2407 | - foreach ($lista as $l) | ||
2408 | - { | ||
2409 | - $geos = &$this->unserializeGeo($dir.$l); | ||
2410 | - //pega todas as geometrias | ||
2411 | - foreach ($geos["dados"] as $geo) | 2414 | + if($tipoLista == "stringArquivos"){ |
2415 | + $lista = explode(",",$lista); | ||
2416 | + $shapes = array(); | ||
2417 | + $valoresoriginais = array(); | ||
2418 | + foreach ($lista as $l) | ||
2412 | { | 2419 | { |
2413 | - //echo $geo["wkt"]."<br>"; | ||
2414 | - $shapes[] = ms_shapeObjFromWkt(str_replace("'","",$geo["wkt"])); | ||
2415 | - foreach ($geo["valores"] as $v) | ||
2416 | - {$valorestemp[] = $v["item"]."=".$v["valor"];} | ||
2417 | - $valoresoriginais[] = implode(" ",$valorestemp); | 2420 | + $geos = &$this->unserializeGeo($dir.$l); |
2421 | + //pega todas as geometrias | ||
2422 | + foreach ($geos["dados"] as $geo) | ||
2423 | + { | ||
2424 | + //echo $geo["wkt"]."<br>"; | ||
2425 | + $shapes[] = ms_shapeObjFromWkt(str_replace("'","",$geo["wkt"])); | ||
2426 | + foreach ($geo["valores"] as $v) | ||
2427 | + {$valorestemp[] = $v["item"]."=".$v["valor"];} | ||
2428 | + $valoresoriginais[] = implode(" ",$valorestemp); | ||
2429 | + } | ||
2418 | } | 2430 | } |
2419 | } | 2431 | } |
2432 | + if($tipoLista == "arraywkt"){ | ||
2433 | + $shapes = array(); | ||
2434 | + $valoresoriginais = array(); | ||
2435 | + foreach ($lista as $l){ | ||
2436 | + $shapes[] = ms_shapeObjFromWkt($l); | ||
2437 | + } | ||
2438 | + } | ||
2420 | //verifica o tipo | 2439 | //verifica o tipo |
2421 | if (count($shapes) == 0){return("erro.");} | 2440 | if (count($shapes) == 0){return("erro.");} |
2422 | $tiposhape = $shapes[0]->type; | 2441 | $tiposhape = $shapes[0]->type; |
classesphp/mapa_controle.php
@@ -338,7 +338,7 @@ A lista de WKTs deve usar o separador | | @@ -338,7 +338,7 @@ A lista de WKTs deve usar o separador | | ||
338 | case "FUNCOESGEOMETRIASWKT": | 338 | case "FUNCOESGEOMETRIASWKT": |
339 | include_once("classe_analise.php"); | 339 | include_once("classe_analise.php"); |
340 | $m = new Analise($map_file,""); | 340 | $m = new Analise($map_file,""); |
341 | - $retorno = $m->aplicaFuncaoListaWKT(explode("|",$geometrias),$operacao); | 341 | + $retorno = $m->aplicaFuncaoListaWKT(explode("|",$geometrias),$operacao,$dir_tmp,$imgdir); |
342 | break; | 342 | break; |
343 | /* | 343 | /* |
344 | Valor: CALCULAGEOMETRIAS | 344 | Valor: CALCULAGEOMETRIAS |
mashups/openlayers.js.php
@@ -120,7 +120,6 @@ i3GEO.editorOL = { | @@ -120,7 +120,6 @@ i3GEO.editorOL = { | ||
120 | {i3GEO.editorOL.mapa.zoomToMaxExtent();} | 120 | {i3GEO.editorOL.mapa.zoomToMaxExtent();} |
121 | i3GEO.editorOL.coordenadas(); | 121 | i3GEO.editorOL.coordenadas(); |
122 | i3GEO.editorOL.criaJanelaBusca(); | 122 | i3GEO.editorOL.criaJanelaBusca(); |
123 | - i3GEO.editorOL.criaJanelaAtivaTema(); | ||
124 | i3GEO.editorOL.criaBotoes(i3GEO.editorOL.botoes); | 123 | i3GEO.editorOL.criaBotoes(i3GEO.editorOL.botoes); |
125 | }, | 124 | }, |
126 | layersLigados: function(){ | 125 | layersLigados: function(){ |
@@ -198,36 +197,52 @@ i3GEO.editorOL = { | @@ -198,36 +197,52 @@ i3GEO.editorOL = { | ||
198 | } | 197 | } |
199 | catch(e){} | 198 | catch(e){} |
200 | }, | 199 | }, |
201 | - criaJanelaAtivaTema: function(){ | 200 | + criaComboTemas: function(){ |
202 | var layers = i3GEO.editorOL.layersLigados(), | 201 | var layers = i3GEO.editorOL.layersLigados(), |
203 | nlayers = layers.length, | 202 | nlayers = layers.length, |
204 | i, | 203 | i, |
205 | temp, | 204 | temp, |
206 | combo = "<select id=i3GEOOLlistaTemasAtivos >"; | 205 | combo = "<select id=i3GEOOLlistaTemasAtivos >"; |
206 | + //i3GEO.editorOL.layergrafico.setLayerIndex(i3GEO.editorOL.getNumLayers() + 1); | ||
207 | for(i=0;i<nlayers;i++){ | 207 | for(i=0;i<nlayers;i++){ |
208 | combo += "<option value='"+i+"' >"+layers[i].name+"</option>"; | 208 | combo += "<option value='"+i+"' >"+layers[i].name+"</option>"; |
209 | } | 209 | } |
210 | combo += "</select>"; | 210 | combo += "</select>"; |
211 | + return combo; | ||
212 | + }, | ||
213 | + atualizaJanelaAtivaTema: function(){ | ||
214 | + var combo = i3GEO.editorOL.criaComboTemas(); | ||
215 | + YAHOO.temaativo.container.panel.setBody(combo); | ||
216 | + document.getElementById("i3GEOOLlistaTemasAtivos").onchange = function(){ | ||
217 | + if(botaoIdentifica){ | ||
218 | + botaoIdentifica.layers = [i3GEO.editorOL.layersLigados()[this.value]]; | ||
219 | + } | ||
220 | + }; | ||
221 | + }, | ||
222 | + criaJanelaAtivaTema: function(){ | ||
223 | + var temp; | ||
211 | if(!document.getElementById("paneltemaativo")){ | 224 | if(!document.getElementById("paneltemaativo")){ |
212 | YAHOO.namespace("temaativo.container"); | 225 | YAHOO.namespace("temaativo.container"); |
213 | YAHOO.temaativo.container.panel = new YAHOO.widget.Panel("paneltemaativo", {zIndex:20000, iframe:true, width:"250px", visible:false, draggable:true, close:true } ); | 226 | YAHOO.temaativo.container.panel = new YAHOO.widget.Panel("paneltemaativo", {zIndex:20000, iframe:true, width:"250px", visible:false, draggable:true, close:true } ); |
214 | - YAHOO.temaativo.container.panel.setBody(combo); | 227 | + YAHOO.temaativo.container.panel.setBody(""); |
215 | if(typeof i3GEO != undefined && i3GEO != "") | 228 | if(typeof i3GEO != undefined && i3GEO != "") |
216 | {YAHOO.temaativo.container.panel.setHeader("Tema ativo<div id='paneltemaativo_minimizaCabecalho' class='container-minimiza'></div>");} | 229 | {YAHOO.temaativo.container.panel.setHeader("Tema ativo<div id='paneltemaativo_minimizaCabecalho' class='container-minimiza'></div>");} |
217 | else | 230 | else |
218 | {YAHOO.temaativo.container.panel.setHeader("Tema ativo");} | 231 | {YAHOO.temaativo.container.panel.setHeader("Tema ativo");} |
219 | YAHOO.temaativo.container.panel.setFooter(""); | 232 | YAHOO.temaativo.container.panel.setFooter(""); |
220 | YAHOO.temaativo.container.panel.render(document.body); | 233 | YAHOO.temaativo.container.panel.render(document.body); |
234 | + YAHOO.temaativo.container.panel.show(); | ||
221 | YAHOO.temaativo.container.panel.center(); | 235 | YAHOO.temaativo.container.panel.center(); |
236 | + i3GEO.editorOL.atualizaJanelaAtivaTema(); | ||
222 | YAHOO.util.Event.addListener(YAHOO.temaativo.container.panel.close, "click", function(){ | 237 | YAHOO.util.Event.addListener(YAHOO.temaativo.container.panel.close, "click", function(){ |
223 | i3GEOpanelEditor.deactivate(); | 238 | i3GEOpanelEditor.deactivate(); |
224 | i3GEOpanelEditor.activate(); | 239 | i3GEOpanelEditor.activate(); |
225 | - if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEO.editorOL.criaJanelaAtivaTema()") > 0) | ||
226 | - {i3GEO.eventos.ATUALIZAARVORECAMADAS.remove("i3GEO.editorOL.criaJanelaAtivaTema()");} | 240 | + if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEO.editorOL.atualizaJanelaAtivaTema()") > 0) |
241 | + {i3GEO.eventos.ATUALIZAARVORECAMADAS.remove("i3GEO.editorOL.atualizaJanelaAtivaTema()");} | ||
227 | }); | 242 | }); |
228 | if(typeof i3GEO != undefined && i3GEO != ""){ | 243 | if(typeof i3GEO != undefined && i3GEO != ""){ |
229 | - if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEO.editorOL.criaJanelaAtivaTema()") < 0) | ||
230 | - {i3GEO.eventos.ATUALIZAARVORECAMADAS.push("i3GEO.editorOL.criaJanelaAtivaTema()");} | 244 | + if(i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEO.editorOL.atualizaJanelaAtivaTema()") < 0) |
245 | + {i3GEO.eventos.ATUALIZAARVORECAMADAS.push("i3GEO.editorOL.atualizaJanelaAtivaTema()");} | ||
231 | } | 246 | } |
232 | temp = $i("paneltemaativo_minimizaCabecalho"); | 247 | temp = $i("paneltemaativo_minimizaCabecalho"); |
233 | if(temp){ | 248 | if(temp){ |
@@ -235,15 +250,8 @@ i3GEO.editorOL = { | @@ -235,15 +250,8 @@ i3GEO.editorOL = { | ||
235 | } | 250 | } |
236 | } | 251 | } |
237 | else{ | 252 | else{ |
238 | - YAHOO.temaativo.container.panel.setBody(combo); | ||
239 | - YAHOO.temaativo.container.panel.render(document.body); | ||
240 | YAHOO.temaativo.container.panel.show(); | 253 | YAHOO.temaativo.container.panel.show(); |
241 | } | 254 | } |
242 | - document.getElementById("i3GEOOLlistaTemasAtivos").onchange = function(){ | ||
243 | - if(botaoIdentifica){ | ||
244 | - botaoIdentifica.layers = [i3GEO.editorOL.layersLigados()[this.value]]; | ||
245 | - } | ||
246 | - }; | ||
247 | }, | 255 | }, |
248 | ativaTema: function(id){ | 256 | ativaTema: function(id){ |
249 | document.getElementById("i3GEOOLlistaTemasAtivos").value = id; | 257 | document.getElementById("i3GEOOLlistaTemasAtivos").value = id; |
@@ -388,29 +396,33 @@ i3GEO.editorOL = { | @@ -388,29 +396,33 @@ i3GEO.editorOL = { | ||
388 | }); | 396 | }); |
389 | }, | 397 | }, |
390 | salvaGeometrias: function(){ | 398 | salvaGeometrias: function(){ |
391 | - try{ | ||
392 | - YAHOO.namespace("salvaGeometrias.container"); | ||
393 | - YAHOO.salvaGeometrias.container.panel = new YAHOO.widget.Panel("panelsalvageometrias", {zIndex:2000, iframe:false, width:"250px", visible:false, draggable:true, close:true } ); | ||
394 | - YAHOO.salvaGeometrias.container.panel.setHeader("Geometrias"); | ||
395 | - YAHOO.salvaGeometrias.container.panel.setBody(""); | ||
396 | - YAHOO.salvaGeometrias.container.panel.setFooter(""); | ||
397 | - YAHOO.salvaGeometrias.container.panel.render(document.body); | ||
398 | - YAHOO.salvaGeometrias.container.panel.center(); | ||
399 | - } | ||
400 | - catch(e){} | ||
401 | - YAHOO.salvaGeometrias.container.panel.show(); | ||
402 | var geos = i3GEO.editorOL.layergrafico.selectedFeatures; | 399 | var geos = i3GEO.editorOL.layergrafico.selectedFeatures; |
403 | var n = geos.length; | 400 | var n = geos.length; |
404 | var ins = ""; | 401 | var ins = ""; |
405 | if(n > 0){ | 402 | if(n > 0){ |
403 | + try{ | ||
404 | + YAHOO.namespace("salvaGeometrias.container"); | ||
405 | + YAHOO.salvaGeometrias.container.panel = new YAHOO.widget.Panel("panelsalvageometrias", {zIndex:2000, iframe:false, width:"250px", visible:false, draggable:true, close:true } ); | ||
406 | + YAHOO.salvaGeometrias.container.panel.setHeader("Geometrias"); | ||
407 | + YAHOO.salvaGeometrias.container.panel.setBody(""); | ||
408 | + YAHOO.salvaGeometrias.container.panel.setFooter(""); | ||
409 | + YAHOO.salvaGeometrias.container.panel.render(document.body); | ||
410 | + YAHOO.salvaGeometrias.container.panel.center(); | ||
411 | + } | ||
412 | + catch(e){} | ||
413 | + YAHOO.salvaGeometrias.container.panel.show(); | ||
406 | ins += "<p class=paragrafo >Foram encontrada(s) "+n+" geometria(s) selecionada(s) </p>"; | 414 | ins += "<p class=paragrafo >Foram encontrada(s) "+n+" geometria(s) selecionada(s) </p>"; |
407 | - ins += "<p class=paragrafo ><a href='#' onclick='i3GEO.editorOL.listaGeometriasSel()' > Listar geometrias</a> "; | ||
408 | - ins += "<a href='#' onclick='"+i3GEO.editorOL.nomeFuncaoSalvar+"' >Salvar geometria(s)</a></p>"; | 415 | + ins += "<p class=paragrafo ><a href='#' onclick='i3GEO.editorOL.listaGeometriasSel()' >Listar</a> "; |
416 | + ins += "<a href='#' onclick='"+i3GEO.editorOL.nomeFuncaoSalvar+"' >Salvar</a> "; | ||
417 | + ins += "<a href='#' onclick='i3GEO.editorOL.exportarSHP()' >Exportar (shapefile)</a></p>"; | ||
409 | YAHOO.salvaGeometrias.container.panel.setBody(ins); | 418 | YAHOO.salvaGeometrias.container.panel.setBody(ins); |
410 | } | 419 | } |
411 | else | 420 | else |
412 | {alert("Selecione pelo menos um elemento");} | 421 | {alert("Selecione pelo menos um elemento");} |
413 | }, | 422 | }, |
423 | + exportarSHP: function(){ | ||
424 | + i3GEO.editorOL.processageo("converteSHP"); | ||
425 | + }, | ||
414 | listaGeometriasSel: function(){ | 426 | listaGeometriasSel: function(){ |
415 | var geos = i3GEO.editorOL.layergrafico.selectedFeatures; | 427 | var geos = i3GEO.editorOL.layergrafico.selectedFeatures; |
416 | var n = geos.length; | 428 | var n = geos.length; |
@@ -631,7 +643,6 @@ i3GEO.editorOL = { | @@ -631,7 +643,6 @@ i3GEO.editorOL = { | ||
631 | { | 643 | { |
632 | displayClass: "editorOLedita", | 644 | displayClass: "editorOLedita", |
633 | title: "modifica figura", | 645 | title: "modifica figura", |
634 | - //onModification: function(evt){alert("oi");i3GEO.editorOL.guardaBackup();}, | ||
635 | clickout: true, | 646 | clickout: true, |
636 | toggle: true, | 647 | toggle: true, |
637 | mode: OpenLayers.Control.ModifyFeature.RESHAPE | 648 | mode: OpenLayers.Control.ModifyFeature.RESHAPE |
@@ -891,9 +902,7 @@ i3GEO.editorOL = { | @@ -891,9 +902,7 @@ i3GEO.editorOL = { | ||
891 | YAHOO.editorOL.container.panel.render(document.body); | 902 | YAHOO.editorOL.container.panel.render(document.body); |
892 | 903 | ||
893 | YAHOO.editorOL.container.panel.center(); | 904 | YAHOO.editorOL.container.panel.center(); |
894 | - YAHOO.util.Event.addListener(YAHOO.editorOL.container.panel.close, "click", function(){}); | ||
895 | - if(i3GEO.eventos && i3GEO.eventos.ATUALIZAARVORECAMADAS.toString().search("i3GEO.editorOL.criaJanelaAtivaTema()") < 0) | ||
896 | - {i3GEO.eventos.ATUALIZAARVORECAMADAS.push("i3GEO.editorOL.criaJanelaAtivaTema()");} | 905 | + YAHOO.util.Event.addListener(YAHOO.editorOL.container.panel.close, "click", function(){}); |
897 | temp = $i("panelpropriedadesEditor_minimizaCabecalho"); | 906 | temp = $i("panelpropriedadesEditor_minimizaCabecalho"); |
898 | if(temp){ | 907 | if(temp){ |
899 | temp.onclick = function(){i3GEO.janela.minimiza("panelpropriedadesEditor");} | 908 | temp.onclick = function(){i3GEO.janela.minimiza("panelpropriedadesEditor");} |
@@ -975,7 +984,7 @@ i3GEO.editorOL = { | @@ -975,7 +984,7 @@ i3GEO.editorOL = { | ||
975 | var geosel = i3GEO.editorOL.layergrafico.selectedFeatures, | 984 | var geosel = i3GEO.editorOL.layergrafico.selectedFeatures, |
976 | fwkt = new OpenLayers.Format.WKT(), | 985 | fwkt = new OpenLayers.Format.WKT(), |
977 | polis,linhas,pontos,uniaopolis,uniaolinhas,uniaopontos,n,i,temp; | 986 | polis,linhas,pontos,uniaopolis,uniaolinhas,uniaopontos,n,i,temp; |
978 | - if(geosel.length > 1){ | 987 | + if(geosel.length > 0){ |
979 | polis = i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.Polygon"); | 988 | polis = i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.Polygon"); |
980 | linhas = i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.LineString"); | 989 | linhas = i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.LineString"); |
981 | pontos = i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.Point"); | 990 | pontos = i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.Point"); |
@@ -983,8 +992,12 @@ i3GEO.editorOL = { | @@ -983,8 +992,12 @@ i3GEO.editorOL = { | ||
983 | i3GEO.janela.fechaAguarde("i3GEO.editorPoli"); | 992 | i3GEO.janela.fechaAguarde("i3GEO.editorPoli"); |
984 | i3GEO.janela.fechaAguarde("i3GEO.editorLinhas"); | 993 | i3GEO.janela.fechaAguarde("i3GEO.editorLinhas"); |
985 | i3GEO.janela.fechaAguarde("i3GEO.editorPontos"); | 994 | i3GEO.janela.fechaAguarde("i3GEO.editorPontos"); |
986 | - if(retorno != "" && retorno.data && retorno.data != "") | 995 | + if(retorno != "" && retorno.data && retorno.data != "" && operacao != "converteSHP") |
987 | {i3GEO.editorOL.substituiFeaturesSel(retorno.data);} | 996 | {i3GEO.editorOL.substituiFeaturesSel(retorno.data);} |
997 | + if(operacao === "converteSHP"){ | ||
998 | + i3GEO.atualiza(); | ||
999 | + i3GEO.janela.minimiza("paneltemaativo"); | ||
1000 | + } | ||
988 | } | 1001 | } |
989 | if(polis.length > 0){ | 1002 | if(polis.length > 0){ |
990 | i3GEO.janela.abreAguarde("i3GEO.editorPoli","Poligonos"); | 1003 | i3GEO.janela.abreAguarde("i3GEO.editorPoli","Poligonos"); |
@@ -999,21 +1012,6 @@ i3GEO.editorOL = { | @@ -999,21 +1012,6 @@ i3GEO.editorOL = { | ||
999 | i3GEO.php.funcoesGeometriasWkt(temp,pontos.join("|"),operacao); | 1012 | i3GEO.php.funcoesGeometriasWkt(temp,pontos.join("|"),operacao); |
1000 | } | 1013 | } |
1001 | return; | 1014 | return; |
1002 | - /* | ||
1003 | - if(polis) | ||
1004 | - {uniaopolis = i3GEO.editorOL.uniaojts(polis);} | ||
1005 | - if(linhas) | ||
1006 | - {uniaolinhas = i3GEO.editorOL.uniaojts(linhas);} | ||
1007 | - if(pontos) | ||
1008 | - {uniaopontos = i3GEO.editorOL.uniaojts(pontos);} | ||
1009 | - | ||
1010 | - if(uniaopolis) | ||
1011 | - {i3GEO.editorOL.layergrafico.addFeatures(uniaopolis);} | ||
1012 | - if(uniaolinhas) | ||
1013 | - {i3GEO.editorOL.layergrafico.addFeatures(uniaolinhas);} | ||
1014 | - if(uniaopontos) | ||
1015 | - {i3GEO.editorOL.layergrafico.addFeatures(uniaopontos);} | ||
1016 | - */ | ||
1017 | } | 1015 | } |
1018 | else | 1016 | else |
1019 | {alert("Selecione pelo menos dois elementos");} | 1017 | {alert("Selecione pelo menos dois elementos");} |