<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi all,<div>I'm trying to create a map with multiple layers, and initialize it by setting its center.</div><div><br></div><div>Code is:</div><div><br></div><div>//javascript + knockout.js</div><div>self.initialize = function() {</div><div>      self.epsg4326(new OpenLayers.Projection("EPSG:4326"));  //self.epsg4326 declared as an observable elsewhere</div><div><br></div><div>      self.map = new OpenLayers.Map('Little basic map');</div><div><br></div><div><div>      self.map.addLayer(new OpenLayers.Layer.OSM("osm",["http://otile1.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.jpg",</div><div><span class="Apple-tab-span" style="white-space:pre">                                                                                                     </span>  "http://otile2.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.jpg",</div><div><span class="Apple-tab-span" style="white-space:pre">                                                                                                  </span>  "http://otile3.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.jpg",</div><div><span class="Apple-tab-span" style="white-space:pre">                                                                                                  </span>  "http://otile4.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.jpg"]));</div><div><span class="Apple-tab-span" style="white-space:pre">                               </span></div><div>      self.map.addLayer(new OpenLayers.Layer.WMS("wms","http://vmap0.tiles.osgeo.org/wms/vmap0",{layers: "basic"}));</div><div><span class="Apple-tab-span" style="white-space:pre">                             </span></div><div>      self.map.addControl(new OpenLayers.Control.LayerSwitcher());</div></div><div><br></div><div>      self.map.setCenter(new OpenLayers.LonLat(-105.0000,37.2500).transform(self.epsg4326(), self.getProjection()), 9);</div><div>      //alternatively:</div><div>      //<span style="font-size: 12pt;">self.map.setCenter(new OpenLayers.LonLat(-105.0000,37.2500), 9);</span></div><div>}</div><div><br></div><div>With the transform, the osm layer is displayed correctly. Centered above Southern Colorado in North America. But, the wms layer is just blank. No "broken link" tile icons, even.</div><div><br></div><div>On the other hand, if I use LonLat without transforming it, the osm map starts out centered around 0,0: somewhere in the Gulf of Guinea. The wms layer works, however. It now starts out centered over Southern Colorado.</div><div><br></div><div>I have similar problems with other Layer types, like Google (which behaves like OSM) & ArcGIS93Rest (which behaves like WMS).</div><div><br></div><div>I've looked at the OpenLayers (2) documentation for Layer.OSM, WMS etc, but it doesn't shed any light on this.</div><div><br></div><div>Has anyone run into a similar problem, or can see what I'm doing wrong?</div><div><br></div><div>Thanks,</div><div><br></div><div>John</div>                                    </div></body>
</html>