Commit ace988ee58b5c2607c85d347def1e5f74a27b260
1 parent
bd257c54
Exists in
master
and in
7 other branches
Atualização do código
Showing
16 changed files
with
131 additions
and
80 deletions
Show diff stats
admin/admin.db
No preview for this file type
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
... | ... | @@ -755,11 +755,12 @@ String contendo vari&aacute;veis no formato javascript |
755 | 755 | */ |
756 | 756 | function retornaReferenciaDinamica($ext="",$w="",$h="") |
757 | 757 | { |
758 | - global $nomeImagem,$map_file,$utilizacgi,$locmapserv,$locaplic,$zoom,$tipo,$interface; | |
758 | + global $nomeImagem,$map_file,$utilizacgi,$locmapserv,$locaplic,$zoom,$tipo,$interface,$postgis_mapa; | |
759 | 759 | // |
760 | 760 | //adiciona o tema com o web service com o mapa mundi |
761 | 761 | // |
762 | 762 | $objMapa = ms_newMapObj($map_file); |
763 | + substituiConObj($objMapa,$postgis_mapa); | |
763 | 764 | $i = $objMapa->getmetadata("interface"); |
764 | 765 | if($i == ""){ |
765 | 766 | $i = $interface; |
... | ... | @@ -862,6 +863,7 @@ function testaMapa($map_file,$postgis_mapa) |
862 | 863 | { |
863 | 864 | substituiCon($map_file,$postgis_mapa); |
864 | 865 | $objMapa = ms_newMapObj($map_file); |
866 | + substituiConObj($objMapa,$postgis_mapa); | |
865 | 867 | ms_ResetErrorList(); |
866 | 868 | $img = $objMapa->draw(); |
867 | 869 | $erros = ""; |
... | ... | @@ -975,6 +977,10 @@ function gravaImagemMapa($mapa) |
975 | 977 | { |
976 | 978 | if(is_string($mapa)) |
977 | 979 | {$mapa = ms_newMapObj($mapa);} |
980 | + | |
981 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
982 | + substituiConObj($mapa,$postgis_mapa); | |
983 | + | |
978 | 984 | $imgo = @$mapa->draw(); |
979 | 985 | if(!$imgo) |
980 | 986 | { |
... | ... | @@ -1149,8 +1155,10 @@ function xy2imagem($map_file,$xy,$map="") |
1149 | 1155 | if (!is_array($xy)) |
1150 | 1156 | {$xy = explode(" ",$xy);} |
1151 | 1157 | $pt = ms_newPointObj(); |
1158 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
1152 | 1159 | if($map == ""){ |
1153 | 1160 | $map = ms_newMapObj($map_file); |
1161 | + substituiConObj($map,$postgis_mapa); | |
1154 | 1162 | $map = desligatemas($map); |
1155 | 1163 | $map = desligamargem($map); |
1156 | 1164 | $imgo = $map->draw(); |
... | ... | @@ -1181,9 +1189,11 @@ Retorno: |
1181 | 1189 | */ |
1182 | 1190 | function imagem2xy($map_file,$xy) |
1183 | 1191 | { |
1192 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
1184 | 1193 | if (!is_array($xy)) |
1185 | 1194 | {$xy = explode(" ",$xy);} |
1186 | 1195 | $map = ms_newMapObj($map_file); |
1196 | + substituiConObj($map,$postgis_mapa); | |
1187 | 1197 | $map = desligatemas($map); |
1188 | 1198 | $map = desligamargem($map); |
1189 | 1199 | $imgo = $map->draw(); |
... | ... | @@ -1454,6 +1464,7 @@ Retorno: |
1454 | 1464 | */ |
1455 | 1465 | function criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand=TRUE,$prj="",$projetaToMap=true) |
1456 | 1466 | { |
1467 | + include(dirname(__FILE__)."/../ms_configura.php"); | |
1457 | 1468 | $versao = versao(); |
1458 | 1469 | $versao = $versao["principal"]; |
1459 | 1470 | //para manipular dbf |
... | ... | @@ -1464,7 +1475,10 @@ function criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand=TRUE,$prj="",$proj |
1464 | 1475 | include_once dirname(__FILE__)."/../pacotes/phpxbase/api_conversion.php"; |
1465 | 1476 | } |
1466 | 1477 | $map = @ms_newMapObj($map_file); |
1478 | + substituiConObj($map,$postgis_mapa); | |
1479 | + | |
1467 | 1480 | $layer = $map->getlayerbyname($tema); |
1481 | + | |
1468 | 1482 | //e necessario abrir ou nao vai projetar |
1469 | 1483 | $layer->open(); |
1470 | 1484 | $prjMapa = $map->getProjection(); |
... | ... | @@ -1802,9 +1816,10 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) |
1802 | 1816 | copy($qyfile,$nqyfile); |
1803 | 1817 | } |
1804 | 1818 | $map->save($map_file); |
1805 | - substituiCon($map_file,$postgis_mapa); | |
1819 | + | |
1806 | 1820 | //$map_file agora contem os LAYERS necessários |
1807 | 1821 | $map = ms_newMapObj($map_file); |
1822 | + substituiConObj($map,$postgis_mapa); | |
1808 | 1823 | // |
1809 | 1824 | //verifica se existe mais de um tema (grupo) montando o array com os temas |
1810 | 1825 | //os grupos podem ter o nome do layer em GROUP ao invés de NAME |
... | ... | @@ -1863,6 +1878,7 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) |
1863 | 1878 | $nomecopia = $dir_tmp."/".basename($meta); |
1864 | 1879 | //para evitar que tente copiar um arquivo mapfile |
1865 | 1880 | $nomecopia = str_replace(".map","",$nomecopia); |
1881 | + $nomecopia = str_replace(".zip","zip",$nomecopia).".zip"; | |
1866 | 1882 | if(file_exists($meta)){ |
1867 | 1883 | if(!file_exists($nomecopia)){ |
1868 | 1884 | copy($meta,$nomecopia); |
... | ... | @@ -1969,6 +1985,7 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) |
1969 | 1985 | //gera um mapfile para download |
1970 | 1986 | // |
1971 | 1987 | $nomemapfileurl = ""; |
1988 | + /* | |
1972 | 1989 | if(file_exists($temasdir."/".$tema.".map")){ |
1973 | 1990 | $maptemp = ms_newMapObj($temasdir."/".$tema.".map"); |
1974 | 1991 | $numlayers = $maptemp->numlayers; |
... | ... | @@ -1984,7 +2001,8 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) |
1984 | 2001 | $maptemp->save($nomemapfile); |
1985 | 2002 | $nomemapfileurl = str_replace($radtmp."/","",$nomemapfile); |
1986 | 2003 | } |
1987 | - 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"); | |
1988 | 2006 | } |
1989 | 2007 | |
1990 | 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"; | ... | ... |