Commit 645a9c0adb4b7cfba92601d6ca32a35d8b4faba6
1 parent
d6dad900
Exists in
master
and in
7 other branches
Correção na função de leitura do getcapabilities e montagem da lista de camadas de webservices WMS
Showing
1 changed file
with
26 additions
and
12 deletions
Show diff stats
classesphp/wmswfs.php
@@ -261,10 +261,10 @@ function temaswms() | @@ -261,10 +261,10 @@ function temaswms() | ||
261 | { | 261 | { |
262 | $r = pegaTag($layer); | 262 | $r = pegaTag($layer); |
263 | $retorna = imprimeTag($r,$retorna); | 263 | $retorna = imprimeTag($r,$retorna); |
264 | - $query = $q.'/Layer/Layer'; | ||
265 | - $layers1 = $xpath->query($query); | 264 | + $layers1 = $xpath->query('Layer',$layer); |
266 | foreach ($layers1 as $layer1) | 265 | foreach ($layers1 as $layer1) |
267 | { | 266 | { |
267 | + $layers2 = $xpath->query('Layer',$layer1); | ||
268 | $r1 = pegaTag($layer1); | 268 | $r1 = pegaTag($layer1); |
269 | $camada1 = $r1["nome"]; | 269 | $camada1 = $r1["nome"]; |
270 | $titulocamada1 = $r1["titulo"]; | 270 | $titulocamada1 = $r1["titulo"]; |
@@ -272,12 +272,13 @@ function temaswms() | @@ -272,12 +272,13 @@ function temaswms() | ||
272 | if($r1["estilos"]) | 272 | if($r1["estilos"]) |
273 | {$retorna = imprimeEstilos($r1["estilos"],$suporta,$retorna,$camada1,$titulocamada1);} | 273 | {$retorna = imprimeEstilos($r1["estilos"],$suporta,$retorna,$camada1,$titulocamada1);} |
274 | else | 274 | else |
275 | - {$retorna[] = "<input style='cursor:pointer' type=radio NAME='checks' onClick='seltema(\"tema\",\"" . $camada1 . "\",\"\",\"default\",\"".$camada1." ".$titulocamada1."\",\"".$suporta."\")' value='" . $camada1 . "'/> default<i>".$titulocamada1."</i></span><br>";} | ||
276 | - | ||
277 | - $query = $q.'/Layer/Layer/Layer'; | ||
278 | - $layers2 = $xpath->query($query); | 275 | + { |
276 | + if($layers2->length == 0) | ||
277 | + $retorna[] = "<input style='cursor:pointer' type=radio NAME='checks' onClick='seltema(\"tema\",\"" . $camada1 . "\",\"\",\"default\",\"".$camada1." ".$titulocamada1."\",\"".$suporta."\")' value='" . $camada1 . "'/> default<i>".$titulocamada1."</i></span><br>"; | ||
278 | + } | ||
279 | foreach ($layers2 as $layer2) | 279 | foreach ($layers2 as $layer2) |
280 | { | 280 | { |
281 | + $layers3 = $xpath->query('Layer',$layer2); | ||
281 | $r2 = pegaTag($layer2); | 282 | $r2 = pegaTag($layer2); |
282 | $camada2 = $r2["nome"]; | 283 | $camada2 = $r2["nome"]; |
283 | $titulocamada2 = $r2["titulo"]; | 284 | $titulocamada2 = $r2["titulo"]; |
@@ -285,19 +286,32 @@ function temaswms() | @@ -285,19 +286,32 @@ function temaswms() | ||
285 | if($r2["estilos"]) | 286 | if($r2["estilos"]) |
286 | {$retorna = imprimeEstilos($r2["estilos"],$suporta,$retorna,$camada2,$titulocamada2);} | 287 | {$retorna = imprimeEstilos($r2["estilos"],$suporta,$retorna,$camada2,$titulocamada2);} |
287 | else | 288 | else |
288 | - {$retorna[] = "<input style='cursor:pointer' type=radio NAME='checks' onClick='seltema(\"tema\",\"" . $camada2 . "\",\"\",\"default\",\"".$camada2." ".$titulocamada2."\",\"".$suporta."\")' value='" . $camada2 . "'/> default <i>".$titulocamada2."</i></span><br>";} | ||
289 | - | ||
290 | - } | 289 | + { |
290 | + if($layers3->length == 0) | ||
291 | + $retorna[] = "<input style='cursor:pointer' type=radio NAME='checks' onClick='seltema(\"tema\",\"" . $camada2 . "\",\"\",\"default\",\"".$camada2." ".$titulocamada2."\",\"".$suporta."\")' value='" . $camada2 . "'/> default <i>".$titulocamada2."</i></span><br>"; | ||
292 | + } | ||
293 | + foreach ($layers3 as $layer3) | ||
294 | + { | ||
295 | + $r3 = pegaTag($layer3); | ||
296 | + $camada3 = $r3["nome"]; | ||
297 | + $titulocamada3 = $r3["titulo"]; | ||
298 | + $retorna = imprimeTag($r3,$retorna); | ||
299 | + if($r3["estilos"]) | ||
300 | + {$retorna = imprimeEstilos($r3["estilos"],$suporta,$retorna,$camada3,$titulocamada3);} | ||
301 | + else | ||
302 | + { | ||
303 | + $retorna[] = "<input style='cursor:pointer' type=radio NAME='checks' onClick='seltema(\"tema\",\"" . $camada3 . "\",\"\",\"default\",\"".$camada3." ".$titulocamada3."\",\"".$suporta."\")' value='" . $camada3 . "'/> default <i>".$titulocamada3."</i></span><br>"; | ||
304 | + } | ||
305 | + } | ||
306 | + } | ||
307 | + if(count($layers2) == 1){$retorna[] = "<hr>";} | ||
291 | } | 308 | } |
292 | - | ||
293 | } | 309 | } |
294 | $retorna[] = "<br>Proj.:<input size=30 id=proj type=text class=digitar value='".implode(",",wms_srs($dom))."'/><br>"; | 310 | $retorna[] = "<br>Proj.:<input size=30 id=proj type=text class=digitar value='".implode(",",wms_srs($dom))."'/><br>"; |
295 | $retorna[] = "<br>Formatos imagem:<input size=30 id=formatos type=text class=digitar value='".implode(",",wms_formats($dom))."'/><br><br>"; | 311 | $retorna[] = "<br>Formatos imagem:<input size=30 id=formatos type=text class=digitar value='".implode(",",wms_formats($dom))."'/><br><br>"; |
296 | $retorna[] = "<br>Formatos info:<input size=30 id=formatosinfo type=text class=digitar value='".implode(",",wms_formatsinfo($dom))."'/><br><br>"; | 312 | $retorna[] = "<br>Formatos info:<input size=30 id=formatosinfo type=text class=digitar value='".implode(",",wms_formatsinfo($dom))."'/><br><br>"; |
297 | $retorna[] = "<br>Versao:<input size=30 id=versao type=text class=digitar value='".(wms_version($dom))."'/><br><br>"; | 313 | $retorna[] = "<br>Versao:<input size=30 id=versao type=text class=digitar value='".(wms_version($dom))."'/><br><br>"; |
298 | $retorna[] = "<br>Suporta SLD:<input size=30 id=suportasld type=text class=digitar value='".$suporta."'/><br><br><br>"; | 314 | $retorna[] = "<br>Suporta SLD:<input size=30 id=suportasld type=text class=digitar value='".$suporta."'/><br><br><br>"; |
299 | - //echo "<pre>"; | ||
300 | - //var_dump($retorna); | ||
301 | $cp->set_data(implode($retorna)); | 315 | $cp->set_data(implode($retorna)); |
302 | } | 316 | } |
303 | function imprimeEstilos($es,$suporta,$retorna,$tval,$tituloalternativo) | 317 | function imprimeEstilos($es,$suporta,$retorna,$tval,$tituloalternativo) |