Commit 2d45b4f35329f37e02da3a895ec7201531881ff7
1 parent
fdbefaac
Exists in
master
and in
7 other branches
Inclusão de verificação da variável $this->layer que aparentemente estava provoc…
…ando erros em alguma situação desconhecida
Showing
1 changed file
with
8 additions
and
0 deletions
Show diff stats
classesphp/classe_shp.php
... | ... | @@ -80,6 +80,8 @@ $tema - nome do tema |
80 | 80 | $this->layer = $this->mapa->getlayerbyname($tema); |
81 | 81 | $this->nome = $tema; |
82 | 82 | } |
83 | + else | |
84 | + {$this->layer = "";} | |
83 | 85 | } |
84 | 86 | /* |
85 | 87 | function: salva |
... | ... | @@ -144,6 +146,8 @@ $projecao - código epsg da projeção das coordenadas |
144 | 146 | */ |
145 | 147 | function insereSHP($xy,$projecao,$item="",$valor="") |
146 | 148 | { |
149 | + if($this->layer == "") | |
150 | + {return("erro");} | |
147 | 151 | if(file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php")) |
148 | 152 | include_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); |
149 | 153 | else |
... | ... | @@ -283,6 +287,8 @@ string - xy |
283 | 287 | */ |
284 | 288 | function listaPontosShape() |
285 | 289 | { |
290 | + if($this->layer == "") | |
291 | + {return("erro");} | |
286 | 292 | $this->layer->open(); |
287 | 293 | $this->layer->whichShapes($this->mapa->extent); |
288 | 294 | $xy = array(); |
... | ... | @@ -312,6 +318,8 @@ $para - linha|poligono |
312 | 318 | include_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); |
313 | 319 | else |
314 | 320 | include_once "../pacotes/phpxbase/api_conversion.php"; |
321 | + if($this->layer == "") | |
322 | + {return("erro");} | |
315 | 323 | $this->layer->set("template","none.htm"); |
316 | 324 | $diretorio = dirname($this->arquivo); |
317 | 325 | $tipol = MS_SHP_ARC; | ... | ... |