<span style="font-family: arial,helvetica,sans-serif;">Hi All,</span><br style="font-family: arial,helvetica,sans-serif;"><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">I'm trying to resolve some strange behavior in my OpenLayers map. I am using a BING maps base layer, and a GeoJson feature collection layer. Both layers display in the map, but the GeoJson layer "acts funny". For one thing, it is slightly offset from where it should be located, and for another, it doesn't move with the BING base layer when I pan the map.</span><br style="font-family: arial,helvetica,sans-serif;">
<br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">I am trying to follow the instructions at </span><span style="font-family: arial,helvetica,sans-serif;" class="gI"><a href="http://docs.openlayers.org/library/spherical_mercator.html#spherical-mercator">http://docs.openlayers.org/library/spherical_mercator.html#spherical-mercator</a>, which seem to be very well written, but may be slightly out of date? For example, the doc says to instantiate a new VirtualEarth layer by doing this:<br>
<br></span><pre style="font-family: arial,helvetica,sans-serif;"><span style="font-family: courier new,monospace;" class="kd">var</span><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;" class="nx">layer</span><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;" class="o">=</span><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;" class="k">new</span><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;" class="nx">OpenLayers</span><span style="font-family: courier new,monospace;" class="p">.</span><span style="font-family: courier new,monospace;" class="nx">Layer</span><span style="font-family: courier new,monospace;" class="p">.</span><span style="font-family: courier new,monospace;" class="nx">VirtualEarth</span><span style="font-family: courier new,monospace;" class="p">(</span><span style="font-family: courier new,monospace;" class="s2">"Virtual Earth"</span><span style="font-family: courier new,monospace;" class="o">,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;" class="p">{</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;" class="nx">sphericalMercator</span><span style="font-family: courier new,monospace;" class="o">:</span><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;" class="kc">true</span><span style="font-family: courier new,monospace;" class="o">,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;" class="nx">maxExtent</span><span style="font-family: courier new,monospace;" class="o">:</span><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;" class="k">new</span><span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;" class="nx">OpenLayers</span><span style="font-family: courier new,monospace;" class="p">.</span><span style="font-family: courier new,monospace;" class="nx">Bounds</span><span style="font-family: courier new,monospace;" class="p">(</span><span style="font-family: courier new,monospace;" class="o">-</span><span style="font-family: courier new,monospace;" class="mf">20037508.34</span><span style="font-family: courier new,monospace;" class="o">,-</span><span style="font-family: courier new,monospace;" class="mf">20037508.34</span><span style="font-family: courier new,monospace;" class="o">,</span><span style="font-family: courier new,monospace;" class="mf">20037508.34</span><span style="font-family: courier new,monospace;" class="o">,</span><span style="font-family: courier new,monospace;" class="mf">20037508.34</span><span style="font-family: courier new,monospace;" class="p">)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </span><span style="font-family: courier new,monospace;" class="p">});</span><br><br><br>But the current examples show using this syntax:<br><br><span style="font-family: courier new,monospace;"> var roads = new OpenLayers.Layer.VirtualEarth("Road Map", </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> { type: VEMapStyle.Shaded,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> numZoomLevels: 21 }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> );</span><br><br><br>In any case, I can't seem to figure out how to apply the projection instructions that are on the doc. Also, I'm not sure if a projection mismatch is causing the problem I'm seeing, but I figure it's a place to start. <br>
<br>Would appreciate some advice regarding how to troubleshoot this.<br><br>Thanks,<br><br>Roger<br></pre><br>