<div>Hi all,<br></div><div></div><div>As before I&#39;m having some problems with some of my GML layers. In particular, I&#39;m trying to display three vector overlays, one of which is meant to be a dynamic POI, but that&#39;s another story. </div>
<div></div><div>The issue is this: Only one of my layers &quot;sites&quot; is displaying correctly. The topo layer only displays at all, and in the wrong place if I specify only the style option. If I specify the projection or format option with the same syntax as I do for the points layer, I can see in firebug that the layer get&#39;s loaded into the browser but if I set the map.getCenter function on the layer, it doesn&#39;t center at all, and zooms to what I assume is the max extent. </div>
<div></div><div>e.g.</div><div>//works</div><div>var topo = new OpenLayers.Layer.GML (&quot;Topography&quot;, &quot;data/topo.gml&quot;,<br>  {<br>  style: {strokeWidth: 1, strokeColor:&quot;#CCCCCC&quot;},<br>  }<br>  );<br>
</div><div></div><div>//doesn&#39;t </div><div>var topo = new OpenLayers.Layer.GML (&quot;Topography&quot;, &quot;data/topo.gml&quot;,<br>  {<br>  style: {strokeWidth: 1, strokeColor:&quot;#CCCCCC&quot;},<br>  projection: new OpenLayers.Projection(&quot;EPSG:4326&quot;),<br>
  format: OpenLayers.Format.GML<br>  }<br>  );<br></div><div></div><div>I&#39;ve stripped out the select controls and popups, and the script works, centers, and displays the one layer (sites) over wms baselayers correctly. Additionally, I&#39;ve been trying to implement the layer.vector for the same layer as sites (sites2), which also get&#39;s loaded into the browser, but doesn&#39;t center if targeted by the map.getCenter function. Essentially, the same behavior as the quirky GML layers (i.e. get&#39;s loaded into the browser, but doesn&#39;t display or if it is displayed is not responsive to the map.getCenter function). I&#39;ve tested each of these GML layers in ArcGIS and they display in the correct alignment. Additionally, the (sites) layer displays as Black seemingly without my having specified a color. Here is the bare minimum code of the script. I know this is kind of long, but I&#39;ve added line breaks for clarity. As always, any help is greatly appreciated</div>
<div>best,</div><div>N</div>
<div></div><div>//</div><div>function init() {<br>                 map = new OpenLayers.Map (&quot;map&quot;, <br>                                 {<br>                                 controls:[<br>                                 new OpenLayers.Control.Navigation(),<br>                                 new OpenLayers.Control.PanZoomBar(),<br>                                 new OpenLayers.Control.LayerSwitcher(),<br>

                                 new OpenLayers.Control.Attribution()],<br>                         sphericalMercator: true,<br>                         maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),<br>                         maxResolution: 156543.0399,<br>                         numZoomLevels: 19,<br>

                         units: &#39;m&#39;,<br>                         projection: new OpenLayers.Projection(&quot;EPSG:900913&quot;),<br>                         displayProjection: new OpenLayers.Projection(&quot;EPSG:4326&quot;),<br>                                 }<br>                 );<br>          <br></div><div>                 var topo = new OpenLayers.Layer.GML (&quot;Topography&quot;, &quot;data/topo.gml&quot;,<br>
                 {<br>                 projection: new OpenLayers.Projection(&quot;EPSG:4326&quot;),<br>
                 format: OpenLayers.Format.GML});<br>                 map.addLayer(topo);<br>          <br></div><div>  var        sites = new OpenLayers.Layer.GML (<br>                 &quot;Archaeological Sites&quot;, &quot;data/siteswatr.gml&quot;,<br>                 {<br>                 style: {pointRadius: 2.5}, <br>

                 projection: new OpenLayers.Projection(&quot;EPSG:4326&quot;),<br>                 format: OpenLayers.Format.GML<br>                 }<br>                 );<br>         map.addLayer(sites);          <br>                 </div><div>var sites2 = new OpenLayers.Layer.Vector (<br>                 &quot;sites2&quot;, {projection: map.displayProjection, strategies: [new OpenLayers.Strategy.Fixed()], protocol: new OpenLayers.Protocol.HTTP({url: &quot;data/siteswatr.gml&quot;, format: [new OpenLayers.Format.GML()]})});<br>

                 map.addLayer(sites2);</div><div></div><div>                 if( ! map.getCenter() ){<br>                 sites.events.register(&#39;loadend&#39;, sites, function(){map.zoomToExtent(sites.getDataExtent())});<br>                 map.setCenter(null, null);<br>                 };<br>
<br></div>