<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div>I'm working with OpenLayers and GeoServer , I'm using a WMS layer to display some items , and as a layer map , the following code :</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;">MAP = {</div><div style="background-color: transparent;"><span class="Apple-tab-span" style="white-space:pre">   </span>map: undefined</div><div style="background-color: transparent;">};</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;">var map = new OpenLayers.Map({</div><div style="background-color:
 transparent;"><span class="Apple-tab-span" style="white-space:pre">  </span>div: "map",</div><div style="background-color: transparent;"><span class="Apple-tab-span" style="white-space:pre">       </span>maxExtent: boundsMap,</div><div style="background-color: transparent;"><span class="Apple-tab-span" style="white-space:pre">       </span>minZoomLevel: 6,</div><div style="background-color: transparent;"><span class="Apple-tab-span" style="white-space:pre">    </span>maxResolution: 0.0146771208047863,</div><div style="background-color: transparent;"><span class="Apple-tab-span" style="white-space:pre">  </span>projection: 'EPSG:4326'</div><div style="background-color: transparent;">});</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;">MAP.map = map;</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;">gmap = new OpenLayers.Layer.Google("Google Streets",{baseLayer:
 false});</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;">format = 'image/png';</div><div style="background-color: transparent;">layerGeoPolitic = new OpenLayers.Layer.WMS(</div><div style="background-color: transparent;">"madeingoias:city_layer - Tiled", GEOSERVER_HOST+"/geoserver/madeingoias/wms",</div><div style="background-color: transparent;">{</div><div style="background-color: transparent;">LAYERS: 'madeingoias:city_layer',</div><div style="background-color: transparent;">STYLES: 'region_planned',</div><div style="background-color: transparent;">format: format,</div><div style="background-color: transparent;">tiled: true,</div><div style="background-color: transparent;">transparent: true,</div><div style="background-color: transparent;">noMagic : true,</div><div style="background-color: transparent;">tilesOrigin : MAP.map.maxExtent.left + ',' + MAP.map.maxExtent.bottom</div><div
 style="background-color: transparent;">},</div><div style="background-color: transparent;">{</div><div style="background-color: transparent;">buffer: 0,</div><div style="background-color: transparent;">displayOutsideMaxExtent: true,</div><div style="background-color: transparent;">isBaseLayer: true,</div><div style="background-color: transparent;">tileOrigin: new OpenLayers.LonLat(-180, -90),</div><div style="background-color: transparent;">yx : {'EPSG:4326' : true}</div><div style="background-color: transparent;">});</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;">MAP.map.addLayers([gmap , layerGeoPolitic]);</div><div><br></div><div><div>Everything works fine , however the big problem occurs when I change the layer to the map and go back to the WMS .</div><div>To change to the map layer I use the following code
 :</div><div><br></div><div><div><br></div><div>MAP.map.setBaseLayer(gmap);</div><div>MAP.map.setCenter(new OpenLayers.LonLat(-49.002457,-16.003576).transform(new OpenLayers.Projection("EPSG:4326"), MAP.map.getProjectionObject()), 0);</div><div>E para voltar para a camada WMS eu utilizo:</div><div>layerGeoPolitic.setVisibility(true);</div><div>MAP.map.setBaseLayer(layerGeoPolitic);</div><div>MAP.map.zoomToExtent(boundsMap);</div><div><br></div><div>The no error in FireFox console, plus map does not appear , and in chrome as it is in the attached image .<br></div><div><br></div><div>Using FireFox is loaded after all I use :<br></div><div><br></div><div><div>MAP.map.setBaseLayer(gmap);</div><div>MAP.map.setBaseLayer(layerGeoPolitic);</div><div>MAP.map.zoomToExtent(boundsMap);</div><div><br></div><div><div>I've tried using a setTimeout to give a delay in code , most still not working .</div><div><br></div><div>Does anyone have any suggestions
 ?</div><div><br></div><div>Thank you for your attention .</div><div>Diego.</div></div></div></div></div></div></body></html>