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,6 +80,8 @@ $tema - nome do tema | ||
80 | $this->layer = $this->mapa->getlayerbyname($tema); | 80 | $this->layer = $this->mapa->getlayerbyname($tema); |
81 | $this->nome = $tema; | 81 | $this->nome = $tema; |
82 | } | 82 | } |
83 | + else | ||
84 | + {$this->layer = "";} | ||
83 | } | 85 | } |
84 | /* | 86 | /* |
85 | function: salva | 87 | function: salva |
@@ -144,6 +146,8 @@ $projecao - código epsg da projeção das coordenadas | @@ -144,6 +146,8 @@ $projecao - código epsg da projeção das coordenadas | ||
144 | */ | 146 | */ |
145 | function insereSHP($xy,$projecao,$item="",$valor="") | 147 | function insereSHP($xy,$projecao,$item="",$valor="") |
146 | { | 148 | { |
149 | + if($this->layer == "") | ||
150 | + {return("erro");} | ||
147 | if(file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php")) | 151 | if(file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php")) |
148 | include_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); | 152 | include_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); |
149 | else | 153 | else |
@@ -283,6 +287,8 @@ string - xy | @@ -283,6 +287,8 @@ string - xy | ||
283 | */ | 287 | */ |
284 | function listaPontosShape() | 288 | function listaPontosShape() |
285 | { | 289 | { |
290 | + if($this->layer == "") | ||
291 | + {return("erro");} | ||
286 | $this->layer->open(); | 292 | $this->layer->open(); |
287 | $this->layer->whichShapes($this->mapa->extent); | 293 | $this->layer->whichShapes($this->mapa->extent); |
288 | $xy = array(); | 294 | $xy = array(); |
@@ -312,6 +318,8 @@ $para - linha|poligono | @@ -312,6 +318,8 @@ $para - linha|poligono | ||
312 | include_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); | 318 | include_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); |
313 | else | 319 | else |
314 | include_once "../pacotes/phpxbase/api_conversion.php"; | 320 | include_once "../pacotes/phpxbase/api_conversion.php"; |
321 | + if($this->layer == "") | ||
322 | + {return("erro");} | ||
315 | $this->layer->set("template","none.htm"); | 323 | $this->layer->set("template","none.htm"); |
316 | $diretorio = dirname($this->arquivo); | 324 | $diretorio = dirname($this->arquivo); |
317 | $tipol = MS_SHP_ARC; | 325 | $tipol = MS_SHP_ARC; |