Commit 38806e1ea2129392a487e942a8b8158457d07287
1 parent
5d3989bc
Exists in
master
Atualização do código
Showing
15 changed files
with
149 additions
and
80 deletions
Show diff stats
classesphp/classe_alteraclasse.php
... | ... | @@ -75,10 +75,16 @@ class Alteraclasse |
75 | 75 | */ |
76 | 76 | function __construct($map_file,$tema="",$locaplic="",$ext="") |
77 | 77 | { |
78 | - //error_reporting(0); | |
78 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
79 | + $this->postgis_mapa = $postgis_mapa; | |
80 | + | |
79 | 81 | include_once(dirname(__FILE__)."/funcoes_gerais.php"); |
82 | + | |
80 | 83 | $this->locaplic = $locaplic; |
84 | + | |
81 | 85 | $this->mapa = ms_newMapObj($map_file); |
86 | + substituiConObj($this->mapa,$postgis_mapa); | |
87 | + | |
82 | 88 | $this->arquivo = str_replace(".map","",$map_file).".map"; |
83 | 89 | $this->layer = ""; |
84 | 90 | if($tema != "" && @$this->mapa->getlayerbyname($tema)){ |
... | ... | @@ -99,12 +105,8 @@ class Alteraclasse |
99 | 105 | */ |
100 | 106 | function salva() |
101 | 107 | { |
102 | - if (connection_aborted()){ | |
103 | - exit(); | |
104 | - } | |
108 | + restauraConObj($this->mapa,$this->postgis_mapa); | |
105 | 109 | $this->mapa->save($this->arquivo); |
106 | - include(dirname(__FILE__)."/../ms_configura.php"); | |
107 | - restauraCon($this->arquivo,$postgis_mapa); | |
108 | 110 | } |
109 | 111 | /* |
110 | 112 | Function: aplicacoresrgb | ... | ... |
classesphp/classe_analise.php
... | ... | @@ -100,7 +100,9 @@ class Analise |
100 | 100 | */ |
101 | 101 | function __construct($map_file,$tema="",$locaplic="",$ext="") |
102 | 102 | { |
103 | - //error_reporting(0); | |
103 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
104 | + $this->postgis_mapa = $postgis_mapa; | |
105 | + | |
104 | 106 | $this->qyfile = str_replace(".map",".qy",$map_file); |
105 | 107 | include_once(dirname(__FILE__)."/funcoes_gerais.php"); |
106 | 108 | if(empty($locaplic)){ |
... | ... | @@ -115,6 +117,8 @@ class Analise |
115 | 117 | } |
116 | 118 | $this->locaplic = $locaplic; |
117 | 119 | $this->mapa = ms_newMapObj($map_file); |
120 | + substituiConObj($this->mapa,$postgis_mapa); | |
121 | + | |
118 | 122 | $this->arquivo = str_replace(".map","",$map_file).".map"; |
119 | 123 | if($tema != "" && @$this->mapa->getlayerbyname($tema)) |
120 | 124 | { |
... | ... | @@ -180,12 +184,8 @@ class Analise |
180 | 184 | */ |
181 | 185 | function salva() |
182 | 186 | { |
183 | - if (connection_aborted()){ | |
184 | - exit(); | |
185 | - } | |
186 | - $this->mapa->save($this->arquivo); | |
187 | - include(dirname(__FILE__)."/../ms_configura.php"); | |
188 | - restauraCon($this->arquivo,$postgis_mapa); | |
187 | + restauraConObj($this->mapa,$this->postgis_mapa); | |
188 | + $this->mapa->save($this->arquivo); | |
189 | 189 | } |
190 | 190 | |
191 | 191 | /* | ... | ... |
classesphp/classe_atributos.php
... | ... | @@ -100,7 +100,9 @@ class Atributos |
100 | 100 | */ |
101 | 101 | function __construct($map_file="",$tema="",$locaplic="",$ext="") |
102 | 102 | { |
103 | - error_reporting(0); | |
103 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
104 | + $this->postgis_mapa = $postgis_mapa; | |
105 | + | |
104 | 106 | if (!function_exists('ms_newMapObj')) { |
105 | 107 | return false; |
106 | 108 | } |
... | ... | @@ -114,6 +116,8 @@ class Atributos |
114 | 116 | $this->qyfile = str_replace(".map",".qy",$map_file); |
115 | 117 | $this->locaplic = $locaplic; |
116 | 118 | $this->mapa = ms_newMapObj($map_file); |
119 | + substituiConObj($this->mapa,$postgis_mapa); | |
120 | + | |
117 | 121 | $this->arquivo = str_replace(".map","",$map_file).".map"; |
118 | 122 | if($tema != "" && @$this->mapa->getlayerbyname($tema)) |
119 | 123 | { |
... | ... | @@ -139,16 +143,11 @@ class Atributos |
139 | 143 | */ |
140 | 144 | function salva() |
141 | 145 | { |
142 | - if (connection_aborted()){ | |
143 | - exit(); | |
144 | - } | |
145 | - if($this->mapa->getmetadata("interface") == "googlemaps") | |
146 | - { | |
146 | + if($this->mapa->getmetadata("interface") == "googlemaps"){ | |
147 | 147 | $this->mapa->setProjection($this->projO); |
148 | 148 | } |
149 | + restauraConObj($this->mapa,$this->postgis_mapa); | |
149 | 150 | $this->mapa->save($this->arquivo); |
150 | - include(dirname(__FILE__)."/../ms_configura.php"); | |
151 | - restauraCon($this->arquivo,$postgis_mapa); | |
152 | 151 | } |
153 | 152 | |
154 | 153 | /* | ... | ... |
classesphp/classe_escala.php
... | ... | @@ -24,7 +24,7 @@ Este programa é distribuído na expectativa de que seja útil |
24 | 24 | porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita |
25 | 25 | de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. |
26 | 26 | Consulte a Licença Pública Geral do GNU para mais detalhes. |
27 | -Você deve ter recebido uma cópia da Licença Pública Geral do | |
27 | +Você deve ter recebido uma c�pia da Licença Pública Geral do | |
28 | 28 | GNU junto com este programa; se não, escreva para a |
29 | 29 | Free Software Foundation, Inc., no endereço |
30 | 30 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. |
... | ... | @@ -68,16 +68,20 @@ $map_file - Endereço do mapfile no servidor. |
68 | 68 | */ |
69 | 69 | function __construct($map_file,$nomeImagem="",$locaplic="") |
70 | 70 | { |
71 | - //error_reporting(0); | |
72 | - if(file_exists($locaplic."/funcoes_gerais.php")) | |
73 | - include_once($locaplic."/funcoes_gerais.php"); | |
74 | - else | |
75 | - include_once("funcoes_gerais.php"); | |
76 | - $this->locaplic = $locaplic; | |
77 | - $this->mapa = ms_newMapObj($map_file); | |
78 | - $this->arquivo = str_replace(".map","",$map_file).".map"; | |
79 | - if ($nomeImagem == "") | |
80 | - {$this->nomeImagem = nomeRandomico();} | |
71 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
72 | + $this->postgis_mapa = $postgis_mapa; | |
73 | + | |
74 | + if(file_exists($locaplic."/funcoes_gerais.php")) | |
75 | + include_once($locaplic."/funcoes_gerais.php"); | |
76 | + else | |
77 | + include_once("funcoes_gerais.php"); | |
78 | + | |
79 | + $this->locaplic = $locaplic; | |
80 | + $this->mapa = ms_newMapObj($map_file); | |
81 | + substituiConObj($this->mapa,$postgis_mapa); | |
82 | + $this->arquivo = str_replace(".map","",$map_file).".map"; | |
83 | + if ($nomeImagem == "") | |
84 | + {$this->nomeImagem = nomeRandomico();} | |
81 | 85 | } |
82 | 86 | /* |
83 | 87 | function: salva |
... | ... | @@ -87,9 +91,8 @@ Salva o mapfile atual |
87 | 91 | */ |
88 | 92 | function salva() |
89 | 93 | { |
94 | + restauraConObj($this->mapa,$this->postgis_mapa); | |
90 | 95 | $this->mapa->save($this->arquivo); |
91 | - include(dirname(__FILE__)."/../ms_configura.php"); | |
92 | - restauraCon($this->arquivo,$postgis_mapa); | |
93 | 96 | } |
94 | 97 | |
95 | 98 | /* | ... | ... |
classesphp/classe_legenda.php
... | ... | @@ -117,7 +117,9 @@ class Legenda |
117 | 117 | |
118 | 118 | function __construct($map_file="",$locaplic="",$tema="",$template="") |
119 | 119 | { |
120 | - //error_reporting(0); | |
120 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
121 | + $this->postgis_mapa = $postgis_mapa; | |
122 | + | |
121 | 123 | include_once(dirname(__FILE__)."/funcoes_gerais.php"); |
122 | 124 | $this->v = versao(); |
123 | 125 | $this->v = $this->v["principal"]; |
... | ... | @@ -127,6 +129,8 @@ class Legenda |
127 | 129 | return; |
128 | 130 | } |
129 | 131 | $this->mapa = ms_newMapObj($map_file); |
132 | + substituiConObj($this->mapa,$postgis_mapa); | |
133 | + | |
130 | 134 | $this->arquivo = str_replace(".map","",$map_file).".map"; |
131 | 135 | if($tema != "" && @$this->mapa->getlayerbyname($tema)) |
132 | 136 | { |
... | ... | @@ -175,9 +179,8 @@ class Legenda |
175 | 179 | function salva() |
176 | 180 | { |
177 | 181 | $this->recalculaSLD(); |
182 | + restauraConObj($this->mapa,$this->postgis_mapa); | |
178 | 183 | $this->mapa->save($this->arquivo); |
179 | - include(dirname(__FILE__)."/../ms_configura.php"); | |
180 | - restauraCon($this->arquivo,$postgis_mapa); | |
181 | 184 | } |
182 | 185 | /* |
183 | 186 | function: recalculaSLD | ... | ... |
classesphp/classe_mapa.php
... | ... | @@ -84,7 +84,9 @@ class Mapa |
84 | 84 | */ |
85 | 85 | function __construct($map_file,$locaplic="") |
86 | 86 | { |
87 | - error_reporting(0); | |
87 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
88 | + $this->postgis_mapa = $postgis_mapa; | |
89 | + | |
88 | 90 | if (!function_exists('ms_newMapObj')) { |
89 | 91 | return false; |
90 | 92 | } |
... | ... | @@ -106,6 +108,8 @@ class Mapa |
106 | 108 | return $this->mapa = false; |
107 | 109 | } |
108 | 110 | $this->mapa = @ms_newMapObj($map_file); |
111 | + substituiConObj($this->mapa,$postgis_mapa); | |
112 | + | |
109 | 113 | $this->arquivo = str_replace(".map","",$map_file).".map"; |
110 | 114 | $c = $this->mapa->numlayers; |
111 | 115 | for ($i=0;$i < $c;++$i){ |
... | ... | @@ -121,9 +125,8 @@ class Mapa |
121 | 125 | */ |
122 | 126 | function salva() |
123 | 127 | { |
128 | + restauraConObj($this->mapa,$this->postgis_mapa); | |
124 | 129 | $this->mapa->save($this->arquivo); |
125 | - include(dirname(__FILE__)."/../ms_configura.php"); | |
126 | - restauraCon($this->arquivo,$postgis_mapa); | |
127 | 130 | } |
128 | 131 | /* |
129 | 132 | Method: listaTemasBuscaRapida | ... | ... |
classesphp/classe_menutemas.php
... | ... | @@ -63,9 +63,9 @@ $idioma - (opcional) pt|en|es|it |
63 | 63 | */ |
64 | 64 | function __construct($map_file="",$perfil="",$locaplic="",$urli3geo="",$editores="",$idioma="pt", $filtro="") |
65 | 65 | { |
66 | - if($locaplic == ""){ | |
67 | - include(dirname(__FILE__)."/../ms_configura.php"); | |
68 | - } | |
66 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
67 | + $this->postgis_mapa = $postgis_mapa; | |
68 | + | |
69 | 69 | $perfil = str_replace(" ",",",$perfil); |
70 | 70 | $this->perfil = explode(",",$perfil); |
71 | 71 | $this->locaplic = $locaplic; |
... | ... | @@ -75,6 +75,8 @@ $idioma - (opcional) pt|en|es|it |
75 | 75 | if (($map_file != "") && (file_exists($map_file))) |
76 | 76 | { |
77 | 77 | $this->mapa = ms_newMapObj($map_file); |
78 | + substituiConObj($this->mapa,$postgis_mapa); | |
79 | + | |
78 | 80 | $this->arquivo = $map_file; |
79 | 81 | if ($this->mapa) |
80 | 82 | { |
... | ... | @@ -681,16 +683,16 @@ nrss - (opcional) n&uacute;mero de registros no rss que ser&atilde;o considerado |
681 | 683 | //TODO verificar a acentuacao das palavras nessa funcao |
682 | 684 | function removeAcentos($s) |
683 | 685 | { |
684 | - $s = ereg_replace("[áàâã]","a",$s); | |
685 | - $s = ereg_replace("[ÁÀÂÃ]","A",$s); | |
686 | - $s = ereg_replace("[éèê]","e",$s); | |
686 | + $s = ereg_replace("[á�âã]","a",$s); | |
687 | + $s = ereg_replace("[Á�ÂÃ]","A",$s); | |
688 | + $s = ereg_replace("[é�ê]","e",$s); | |
687 | 689 | $s = ereg_replace("[í]","i",$s); |
688 | 690 | $s = ereg_replace("[Í]","I",$s); |
689 | - $s = ereg_replace("[ÉÈÊ]","E",$s); | |
690 | - $s = ereg_replace("[óòôõ]","o",$s); | |
691 | - $s = ereg_replace("[ÓÒÔÕ]","O",$s); | |
692 | - $s = ereg_replace("[úùû]","u",$s); | |
693 | - $s = ereg_replace("[ÚÙÛ]","U",$s); | |
691 | + $s = ereg_replace("[É�Ê]","E",$s); | |
692 | + $s = ereg_replace("[��ôõ]","o",$s); | |
693 | + $s = ereg_replace("[��ÔÕ]","O",$s); | |
694 | + $s = ereg_replace("[ú��]","u",$s); | |
695 | + $s = ereg_replace("[��]","U",$s); | |
694 | 696 | $s = str_replace("ç","c",$s); |
695 | 697 | $s = str_replace("Ç","C",$s); |
696 | 698 | //$str = htmlentities($s); | ... | ... |
classesphp/classe_navegacao.php
... | ... | @@ -26,7 +26,7 @@ Este programa &eacute; distribu&iacute;do na expectativa de que seja &uacute;til |
26 | 26 | porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita |
27 | 27 | de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. |
28 | 28 | Consulte a Licença Pública Geral do GNU para mais detalhes. |
29 | -Você deve ter recebido uma cópia da Licença Pública Geral do | |
29 | +Você deve ter recebido uma c�pia da Licença Pública Geral do | |
30 | 30 | GNU junto com este programa; se não, escreva para a |
31 | 31 | Free Software Foundation, Inc., no endereço |
32 | 32 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. |
... | ... | @@ -63,12 +63,16 @@ $map_file - string $map_file Endere&ccedil;o do mapfile no servidor. |
63 | 63 | */ |
64 | 64 | function __construct($map_file,$locaplic="") |
65 | 65 | { |
66 | - //error_reporting(0); | |
66 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
67 | + $this->postgis_mapa = $postgis_mapa; | |
68 | + | |
67 | 69 | if(file_exists($locaplic."/funcoes_gerais.php")) |
68 | 70 | include_once($locaplic."/funcoes_gerais.php"); |
69 | 71 | else |
70 | 72 | include_once("funcoes_gerais.php"); |
73 | + | |
71 | 74 | $this->mapa = ms_newMapObj($map_file); |
75 | + substituiConObj($this->mapa,$postgis_mapa); | |
72 | 76 | $this->arquivo = str_replace(".map","",$map_file).".map"; |
73 | 77 | } |
74 | 78 | /* |
... | ... | @@ -78,9 +82,8 @@ Salva o mapfile atual |
78 | 82 | */ |
79 | 83 | function salva() |
80 | 84 | { |
81 | - $this->mapa->save($this->arquivo); | |
82 | - include(dirname(__FILE__)."/../ms_configura.php"); | |
83 | - restauraCon($this->arquivo,$postgis_mapa); | |
85 | + restauraConObj($this->mapa,$this->postgis_mapa); | |
86 | + $this->mapa->save($this->arquivo); | |
84 | 87 | } |
85 | 88 | /* |
86 | 89 | function: gravaImagemCorpo (depreciado) | ... | ... |
classesphp/classe_selecao.php
... | ... | @@ -143,8 +143,8 @@ Salva o mapfile atual |
143 | 143 | if($this->mapa->getmetadata("interface") == "googlemaps"){ |
144 | 144 | $this->mapa->setProjection($this->projO); |
145 | 145 | } |
146 | + restauraConObj($this->mapa,$this->postgis_mapa); | |
146 | 147 | $this->mapa->save($this->arquivo); |
147 | - restauraCon($this->arquivo,$this->postgis_mapa); | |
148 | 148 | } |
149 | 149 | /* |
150 | 150 | function: nSel | ... | ... |
classesphp/classe_shp.php
... | ... | @@ -94,6 +94,9 @@ $ext - extensao geogr&aacute;fica que ser&aacute; aplicada ao mapa |
94 | 94 | if(!function_exists("corRGB")){ |
95 | 95 | include_once(dirname(__FILE__)."/funcoes_gerais.php"); |
96 | 96 | } |
97 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
98 | + $this->postgis_mapa = $postgis_mapa; | |
99 | + | |
97 | 100 | $this->v = versao(); |
98 | 101 | $this->v = $this->v["principal"]; |
99 | 102 | $this->dbaseExiste = false; |
... | ... | @@ -103,6 +106,8 @@ $ext - extensao geogr&aacute;fica que ser&aacute; aplicada ao mapa |
103 | 106 | |
104 | 107 | if($map_file != ""){ |
105 | 108 | $this->mapa = ms_newMapObj($map_file); |
109 | + substituiConObj($this->mapa,$postgis_mapa); | |
110 | + | |
106 | 111 | $this->arquivo = str_replace(".map","",$map_file).".map"; |
107 | 112 | $this->tema = $tema; |
108 | 113 | if($tema != "" && @$this->mapa->getlayerbyname($tema)){ |
... | ... | @@ -127,9 +132,8 @@ Salva o mapfile atual |
127 | 132 | */ |
128 | 133 | function salva() |
129 | 134 | { |
135 | + restauraConObj($this->mapa,$this->postgis_mapa); | |
130 | 136 | $this->mapa->save($this->arquivo); |
131 | - include(dirname(__FILE__)."/../ms_configura.php"); | |
132 | - restauraCon($this->arquivo,$postgis_mapa); | |
133 | 137 | } |
134 | 138 | /* |
135 | 139 | function: criaSHPvazio | ... | ... |
classesphp/classe_temas.php
... | ... | @@ -117,22 +117,27 @@ $ext - (opcional) extens&atilde;o geogr&aacute;fica que ser&aacute; aplicada ao |
117 | 117 | */ |
118 | 118 | function __construct($map_file,$tema=null,$locaplic="",$ext="") |
119 | 119 | { |
120 | - //error_reporting(0); | |
120 | + //error_reporting(0); | |
121 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
122 | + $this->postgis_mapa = $postgis_mapa; | |
123 | + | |
121 | 124 | $map_file = str_replace(".map","",$map_file).".map"; |
122 | 125 | $this->qyfile = str_replace(".map",".qy",$map_file); |
123 | 126 | $this->arquivo = $map_file; |
124 | - if(file_exists($locaplic."/funcoes_gerais.php")) | |
127 | + if(file_exists($locaplic."/funcoes_gerais.php")) | |
125 | 128 | include_once($locaplic."/funcoes_gerais.php"); |
126 | - else | |
129 | + else | |
127 | 130 | include_once("funcoes_gerais.php"); |
131 | + | |
128 | 132 | $this->v = versao(); |
129 | 133 | $this->vi = $this->v["inteiro"]; |
130 | 134 | $this->v = $this->v["principal"]; |
131 | 135 | |
132 | - $this->locaplic = $locaplic; | |
133 | - if($map_file != "") | |
136 | + $this->locaplic = $locaplic; | |
137 | + if($map_file != "") | |
134 | 138 | { |
135 | 139 | $this->mapa = ms_newMapObj($map_file); |
140 | + substituiConObj($this->mapa,$postgis_mapa); | |
136 | 141 | $this->arquivo = $map_file; |
137 | 142 | if($tema != "") |
138 | 143 | { |
... | ... | @@ -170,9 +175,8 @@ Salva o mapfile atual |
170 | 175 | */ |
171 | 176 | function salva() |
172 | 177 | { |
178 | + restauraConObj($this->mapa,$this->postgis_mapa); | |
173 | 179 | $this->mapa->save($this->arquivo); |
174 | - include(dirname(__FILE__)."/../ms_configura.php"); | |
175 | - restauraCon($this->arquivo,$postgis_mapa); | |
176 | 180 | } |
177 | 181 | /* |
178 | 182 | function: pegaMetadata | ... | ... |
classesphp/classe_toponimia.php
... | ... | @@ -26,7 +26,7 @@ Este programa &eacute; distribu&iacute;do na expectativa de que seja &uacute;til |
26 | 26 | porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita |
27 | 27 | de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. |
28 | 28 | Consulte a Licença Pública Geral do GNU para mais detalhes. |
29 | -Você deve ter recebido uma cópia da Licença Pública Geral do | |
29 | +Você deve ter recebido uma c�pia da Licença Pública Geral do | |
30 | 30 | GNU junto com este programa; se não, escreva para a |
31 | 31 | Free Software Foundation, Inc., no endereço |
32 | 32 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. |
... | ... | @@ -91,15 +91,21 @@ $tema - nome do tema que ser&aacute; processado |
91 | 91 | */ |
92 | 92 | function __construct($map_file,$tema="",$locaplic="") |
93 | 93 | { |
94 | - //error_reporting(0); | |
94 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
95 | + $this->postgis_mapa = $postgis_mapa; | |
96 | + | |
95 | 97 | if(file_exists($locaplic."/funcoes_gerais.php")) |
96 | 98 | include_once($locaplic."/funcoes_gerais.php"); |
97 | 99 | else |
98 | 100 | include_once("funcoes_gerais.php"); |
101 | + | |
99 | 102 | $this->v = versao(); |
100 | 103 | $this->vi = $this->v["inteiro"]; |
101 | 104 | $this->v = $this->v["principal"]; |
105 | + | |
102 | 106 | $this->mapa = ms_newMapObj($map_file); |
107 | + substituiConObj($this->mapa,$postgis_mapa); | |
108 | + | |
103 | 109 | $this->arquivo = str_replace(".map","",$map_file).".map"; |
104 | 110 | if($tema != "" && @$this->mapa->getlayerbyname($tema)) |
105 | 111 | $this->layer = $this->mapa->getlayerbyname($tema); |
... | ... | @@ -112,9 +118,8 @@ Salva o mapfile atual |
112 | 118 | */ |
113 | 119 | function salva() |
114 | 120 | { |
121 | + restauraConObj($this->mapa,$this->postgis_mapa); | |
115 | 122 | $this->mapa->save($this->arquivo); |
116 | - include(dirname(__FILE__)."/../ms_configura.php"); | |
117 | - restauraCon($this->arquivo,$postgis_mapa); | |
118 | 123 | } |
119 | 124 | /* |
120 | 125 | function: criaToponimia |
... | ... | @@ -171,7 +176,7 @@ $novotema sim|nao Cria um novo tema ou n&atilde;o, nesse &uacute;ltimo caso, a t |
171 | 176 | |
172 | 177 | Retorno: |
173 | 178 | |
174 | -{string} - código do layer criado | |
179 | +{string} - c�digo do layer criado | |
175 | 180 | */ |
176 | 181 | function criaToponimia($item,$position,$partials,$offsetx,$offsety,$minfeaturesize,$mindistance,$force,$shadowcolor,$shadowsizex,$shadowsizey,$outlinecolor,$cor,$sombray,$sombrax,$sombra,$fundo,$angulo,$tamanho,$fonte,$tipo,$wrap,$novotema="sim") |
177 | 182 | { | ... | ... |
classesphp/classe_vermultilayer.php
... | ... | @@ -24,7 +24,7 @@ Este programa &eacute; distribu&iacute;do na expectativa de que seja &uacute;til |
24 | 24 | porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita |
25 | 25 | de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. |
26 | 26 | Consulte a Licença Pública Geral do GNU para mais detalhes. |
27 | -Você deve ter recebido uma cópia da Licença Pública Geral do | |
27 | +Você deve ter recebido uma c�pia da Licença Pública Geral do | |
28 | 28 | GNU junto com este programa; se não, escreva para a |
29 | 29 | Free Software Foundation, Inc., no endereço |
30 | 30 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. |
... | ... | @@ -47,7 +47,7 @@ class vermultilayer |
47 | 47 | /* |
48 | 48 | Variavel: $temas |
49 | 49 | |
50 | - Lista de códigos dos temas | |
50 | + Lista de c�digos dos temas | |
51 | 51 | */ |
52 | 52 | var $temas; //lista de nomes de temas se for um grupo |
53 | 53 | /* |
... | ... | @@ -71,7 +71,7 @@ class vermultilayer |
71 | 71 | /* |
72 | 72 | Variavel: $temasvisiveis |
73 | 73 | |
74 | - Lista com os códigos dos temas visíveis | |
74 | + Lista com os c�digos dos temas visíveis | |
75 | 75 | */ |
76 | 76 | var $temasvisiveis; //temas vi'siveis na escala |
77 | 77 | /* |
... | ... | @@ -82,11 +82,16 @@ class vermultilayer |
82 | 82 | parameters: |
83 | 83 | $mapfile - arquivo mapfile |
84 | 84 | |
85 | - $tema - código do tema que será verificado | |
85 | + $tema - c�digo do tema que será verificado | |
86 | 86 | */ |
87 | 87 | function verifica($mapfile,$tema) //$mapfile = arquivo .map, $tema = nome do layer |
88 | 88 | { |
89 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
90 | + $this->postgis_mapa = $postgis_mapa; | |
91 | + | |
89 | 92 | $map = ms_newMapObj($mapfile); |
93 | + substituiConObj($this->mapa,$postgis_mapa); | |
94 | + | |
90 | 95 | $map->preparequery(); |
91 | 96 | $escala = $map->scaledenom ; |
92 | 97 | $multilayer = 0; | ... | ... |
classesphp/funcoes_gerais.php
... | ... | @@ -632,6 +632,24 @@ function restauraCon($map_file,$postgis_mapa) |
632 | 632 | $objMap->save($map_file); |
633 | 633 | } |
634 | 634 | } |
635 | +function restauraConObj($objMap,$postgis_mapa) | |
636 | +{ | |
637 | + if (!empty($postgis_mapa)) | |
638 | + { | |
639 | + $numlayers = $objMap->numlayers; | |
640 | + for ($i=0;$i < $numlayers;++$i) | |
641 | + { | |
642 | + $layer = $objMap->getlayer($i); | |
643 | + if ($layer->connectiontype == MS_POSTGIS) | |
644 | + { | |
645 | + if (!is_array($postgis_mapa) && $layer->connection == $postgis_mapa) | |
646 | + {$layer->set("connection"," ");} | |
647 | + if($layer->getmetadata("conexaooriginal") != "") | |
648 | + {$layer->set("connection",$layer->getmetadata("conexaooriginal"));} | |
649 | + } | |
650 | + } | |
651 | + } | |
652 | +} | |
635 | 653 | /* |
636 | 654 | Function: retornaReferencia |
637 | 655 | |
... | ... | @@ -737,11 +755,12 @@ String contendo vari&aacute;veis no formato javascript |
737 | 755 | */ |
738 | 756 | function retornaReferenciaDinamica($ext="",$w="",$h="") |
739 | 757 | { |
740 | - global $nomeImagem,$map_file,$utilizacgi,$locmapserv,$locaplic,$zoom,$tipo,$interface; | |
758 | + global $nomeImagem,$map_file,$utilizacgi,$locmapserv,$locaplic,$zoom,$tipo,$interface,$postgis_mapa; | |
741 | 759 | // |
742 | 760 | //adiciona o tema com o web service com o mapa mundi |
743 | 761 | // |
744 | 762 | $objMapa = ms_newMapObj($map_file); |
763 | + substituiConObj($objMapa,$postgis_mapa); | |
745 | 764 | $i = $objMapa->getmetadata("interface"); |
746 | 765 | if($i == ""){ |
747 | 766 | $i = $interface; |
... | ... | @@ -844,6 +863,7 @@ function testaMapa($map_file,$postgis_mapa) |
844 | 863 | { |
845 | 864 | substituiCon($map_file,$postgis_mapa); |
846 | 865 | $objMapa = ms_newMapObj($map_file); |
866 | + substituiConObj($objMapa,$postgis_mapa); | |
847 | 867 | ms_ResetErrorList(); |
848 | 868 | $img = $objMapa->draw(); |
849 | 869 | $erros = ""; |
... | ... | @@ -957,6 +977,10 @@ function gravaImagemMapa($mapa) |
957 | 977 | { |
958 | 978 | if(is_string($mapa)) |
959 | 979 | {$mapa = ms_newMapObj($mapa);} |
980 | + | |
981 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
982 | + substituiConObj($mapa,$postgis_mapa); | |
983 | + | |
960 | 984 | $imgo = @$mapa->draw(); |
961 | 985 | if(!$imgo) |
962 | 986 | { |
... | ... | @@ -1131,8 +1155,10 @@ function xy2imagem($map_file,$xy,$map="") |
1131 | 1155 | if (!is_array($xy)) |
1132 | 1156 | {$xy = explode(" ",$xy);} |
1133 | 1157 | $pt = ms_newPointObj(); |
1158 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
1134 | 1159 | if($map == ""){ |
1135 | 1160 | $map = ms_newMapObj($map_file); |
1161 | + substituiConObj($map,$postgis_mapa); | |
1136 | 1162 | $map = desligatemas($map); |
1137 | 1163 | $map = desligamargem($map); |
1138 | 1164 | $imgo = $map->draw(); |
... | ... | @@ -1163,9 +1189,11 @@ Retorno: |
1163 | 1189 | */ |
1164 | 1190 | function imagem2xy($map_file,$xy) |
1165 | 1191 | { |
1192 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
1166 | 1193 | if (!is_array($xy)) |
1167 | 1194 | {$xy = explode(" ",$xy);} |
1168 | 1195 | $map = ms_newMapObj($map_file); |
1196 | + substituiConObj($map,$postgis_mapa); | |
1169 | 1197 | $map = desligatemas($map); |
1170 | 1198 | $map = desligamargem($map); |
1171 | 1199 | $imgo = $map->draw(); |
... | ... | @@ -1436,6 +1464,7 @@ Retorno: |
1436 | 1464 | */ |
1437 | 1465 | function criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand=TRUE,$prj="",$projetaToMap=true) |
1438 | 1466 | { |
1467 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
1439 | 1468 | $versao = versao(); |
1440 | 1469 | $versao = $versao["principal"]; |
1441 | 1470 | //para manipular dbf |
... | ... | @@ -1446,7 +1475,10 @@ function criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand=TRUE,$prj="",$proj |
1446 | 1475 | include_once dirname(__FILE__)."/../pacotes/phpxbase/api_conversion.php"; |
1447 | 1476 | } |
1448 | 1477 | $map = @ms_newMapObj($map_file); |
1478 | + substituiConObj($map,$postgis_mapa); | |
1479 | + | |
1449 | 1480 | $layer = $map->getlayerbyname($tema); |
1481 | + | |
1450 | 1482 | //e necessario abrir ou nao vai projetar |
1451 | 1483 | $layer->open(); |
1452 | 1484 | $prjMapa = $map->getProjection(); |
... | ... | @@ -1784,9 +1816,10 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) |
1784 | 1816 | copy($qyfile,$nqyfile); |
1785 | 1817 | } |
1786 | 1818 | $map->save($map_file); |
1787 | - substituiCon($map_file,$postgis_mapa); | |
1819 | + | |
1788 | 1820 | //$map_file agora contem os LAYERS necessários |
1789 | 1821 | $map = ms_newMapObj($map_file); |
1822 | + substituiConObj($map,$postgis_mapa); | |
1790 | 1823 | // |
1791 | 1824 | //verifica se existe mais de um tema (grupo) montando o array com os temas |
1792 | 1825 | //os grupos podem ter o nome do layer em GROUP ao invés de NAME |
... | ... | @@ -1845,6 +1878,7 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) |
1845 | 1878 | $nomecopia = $dir_tmp."/".basename($meta); |
1846 | 1879 | //para evitar que tente copiar um arquivo mapfile |
1847 | 1880 | $nomecopia = str_replace(".map","",$nomecopia); |
1881 | + $nomecopia = str_replace(".zip","zip",$nomecopia).".zip"; | |
1848 | 1882 | if(file_exists($meta)){ |
1849 | 1883 | if(!file_exists($nomecopia)){ |
1850 | 1884 | copy($meta,$nomecopia); |
... | ... | @@ -1951,6 +1985,7 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) |
1951 | 1985 | //gera um mapfile para download |
1952 | 1986 | // |
1953 | 1987 | $nomemapfileurl = ""; |
1988 | + /* | |
1954 | 1989 | if(file_exists($temasdir."/".$tema.".map")){ |
1955 | 1990 | $maptemp = ms_newMapObj($temasdir."/".$tema.".map"); |
1956 | 1991 | $numlayers = $maptemp->numlayers; |
... | ... | @@ -1966,7 +2001,8 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) |
1966 | 2001 | $maptemp->save($nomemapfile); |
1967 | 2002 | $nomemapfileurl = str_replace($radtmp."/","",$nomemapfile); |
1968 | 2003 | } |
1969 | - return array("tema"=>$tema,"mapfile"=>$nomemapfile,"mapfileurl"=>$nomemapfileurl,"arquivos"=>implode(",",$resultado),"nreg"=>$nreg,"datas"=>$dataArquivos, "shape-zip"=>$nomeshp.".zip"); | |
2004 | + */ | |
2005 | + return array("tema"=>$tema,"mapfile"=>"","mapfileurl"=>"","arquivos"=>implode(",",$resultado),"nreg"=>$nreg,"datas"=>$dataArquivos, "shape-zip"=>$nomeshp.".zip"); | |
1970 | 2006 | } |
1971 | 2007 | |
1972 | 2008 | /* | ... | ... |
json.php
... | ... | @@ -125,10 +125,10 @@ autoClasses($l,$oMap); |
125 | 125 | ms_newLayerObj($oMap, $l); |
126 | 126 | |
127 | 127 | $oMap->save($nomeMapfileTmp); |
128 | -restauraCon($nomeMapfileTmp,$postgis_mapa); | |
129 | 128 | validaAcessoTemas($nomeMapfileTmp,true); |
130 | - | |
131 | 129 | $oMap = ms_newMapobj($nomeMapfileTmp); |
130 | +restauraCon($nomeMapfileTmp,$postgis_mapa); | |
131 | + | |
132 | 132 | $layer = $oMap->getlayerbyname($tema); |
133 | 133 | if($layer == ""){ |
134 | 134 | echo "Layer nao encontrado"; | ... | ... |