Commit 828e5e139e5fd8072f8200c5ac174d045ed372ee
1 parent
32cd53cb
Exists in
master
and in
7 other branches
Correção na inclusão de parâmetros
Showing
1 changed file
with
20 additions
and
9 deletions
Show diff stats
mashups/openlayers.js.php
| ... | ... | @@ -12,7 +12,7 @@ i3GEOOL = { |
| 12 | 12 | ol_mma: new OpenLayers.Layer.WMS( |
| 13 | 13 | "Base cartográfica", |
| 14 | 14 | "http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map&", |
| 15 | - {layers:'baseraster',SRS:'EPSG:4291'} | |
| 15 | + {layers:'baseraster',SRS:'EPSG:4291',FORMAT:'image/png'} | |
| 16 | 16 | ), |
| 17 | 17 | ol_wms: new OpenLayers.Layer.WMS.Untiled( |
| 18 | 18 | "OpenLayers WMS", |
| ... | ... | @@ -25,7 +25,12 @@ i3GEOOL = { |
| 25 | 25 | {layers: "landsat7"} |
| 26 | 26 | ), |
| 27 | 27 | layergrafico: new OpenLayers.Layer.Vector("Edição"), |
| 28 | - layersIniciais: <?php echo implode(",",$objOpenLayers); ?>, | |
| 28 | + layersIniciais: <?php | |
| 29 | + if(isset($objOpenLayers) && $objOpenLayers != "") | |
| 30 | + echo implode(",",$objOpenLayers); | |
| 31 | + else | |
| 32 | + echo "''"; | |
| 33 | + ?>, | |
| 29 | 34 | botoes: <?php echo $botoes; ?>, |
| 30 | 35 | mapa: new OpenLayers.Map('i3geoMapa', { |
| 31 | 36 | controls: [ |
| ... | ... | @@ -35,15 +40,21 @@ i3GEOOL = { |
| 35 | 40 | maxExtent: new OpenLayers.Bounds(<?php echo $maxextent;?>) |
| 36 | 41 | }), |
| 37 | 42 | inicia: function(){ |
| 43 | + var alayers = []; | |
| 38 | 44 | i3GEOOL.jpl_wms.setVisibility(false); |
| 39 | 45 | i3GEOOL.ol_wms.setVisibility(false); |
| 40 | - i3GEOOL.mapa.addLayers([ | |
| 41 | - i3GEOOL.ol_mma, | |
| 42 | - i3GEOOL.ol_wms, | |
| 43 | - i3GEOOL.jpl_wms, | |
| 44 | - i3GEOOL.layersIniciais, | |
| 45 | - i3GEOOL.layergrafico | |
| 46 | - ]); | |
| 46 | + if(i3GEOOL.ol_mma != "") | |
| 47 | + {alayers.push(i3GEOOL.ol_mma);} | |
| 48 | + if(i3GEOOL.ol_wms != "") | |
| 49 | + {alayers.push(i3GEOOL.ol_wms);} | |
| 50 | + if(i3GEOOL.jpl_wms != "") | |
| 51 | + {alayers.push(i3GEOOL.jpl_wms);} | |
| 52 | + if(i3GEOOL.layersIniciais != "") | |
| 53 | + {alayers.push(i3GEOOL.layersIniciais);} | |
| 54 | + if(i3GEOOL.layergrafico != "") | |
| 55 | + {alayers.push(i3GEOOL.layergrafico);} | |
| 56 | + | |
| 57 | + i3GEOOL.mapa.addLayers(alayers); | |
| 47 | 58 | i3GEOOL.mapa.zoomToMaxExtent(); |
| 48 | 59 | i3GEOOL.coordenadas(); |
| 49 | 60 | i3GEOOL.criaJanelaBusca(); | ... | ... |