<font color="#000000"><font size="2"><font face="trebuchet ms,sans-serif">IMHP<br>reprojecting the map is better than reprojecting each feature every time you switch beetween layers.<br>so in my project i set map options to<br>

       projection: new OpenLayers.Projection(&quot;EPSG:900913&quot;),<br>       displayProjection: new OpenLayers.Projection(&quot;EPSG:4326&quot;),<br>       maxResolution: &quot;auto&quot;,<br>       maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),<br>

<br>and then add<br>         gmap = new OpenLayers.Layer.Google(&quot;Google Terrain&quot;,{ type: G_PHYSICAL_MAP, sphericalMercator:true}); <br>         bing = new OpenLayers.Layer.VirtualEarth(&quot;Aerial&quot;, { type: VEMapStyle.Aerial, sphericalMercator:true}); <br>

         vector = new OpenLayers.Layer.Vector(&quot;vectors&quot;);<br><br>more info on reprojecting and spherical marcator at <a href="http://docs.openlayers.org/library/spherical_mercator.html">http://docs.openlayers.org/library/spherical_mercator.html</a><br>

<br>but i&#39;m using ol since a month so may be i&#39;m wrong!!<br><br><br>-Vito-<br><br><br><br></font></font></font>--<br>-----------<br>Tafuni Vito<br><a href="mailto:vito@vitotafuni.com">vito@vitotafuni.com</a><br>---------------------------------------------<br>

&quot;Verba volant, scripta manent... data corrupted&quot;<br>
<br><br><div class="gmail_quote">2010/7/1  <span dir="ltr">&lt;<a href="mailto:christopher.schmidt@nokia.com">christopher.schmidt@nokia.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="im"><br>
On Jun 30, 2010, at 7:02 PM, ext Stephen Woodbridge wrote:<br>
<br>
&gt; Hi all,<br>
&gt;<br>
&gt; I have an OL app setup the is using epsg4326 and everything it fine.<br>
&gt; It has a mapserver base layer and a vector overlay with markers and<br>
&gt; another with lines.<br>
&gt;<br>
&gt; I have been asked to add Google as an additional base layer.<br>
&gt;<br>
&gt; So my understanding is that the map object will take on the projection<br>
&gt; of the base layer when you switch between them.<br>
&gt;<br>
&gt; I have few questions:<br>
&gt;<br>
&gt; 1. I assume that the vector features are not transformed when the base<br>
&gt; layer is switched? Is this true? Which probably means I need to cycle<br>
&gt; through the features and transform them to the base layers projection<br>
&gt; something like:<br>
&gt;<br>
&gt; map.events.register(&#39;changebaselayer&#39;, map, function(evt, element) {<br>
&gt;     var fromProj = map.getUnit()==&#39;m&#39;?epsg4326:epsg900913;<br>
&gt;     for (var i=0, var len=layer.features.length; i&lt;len; i++)<br>
&gt;         layer.features[i].geometry.transform(fromProj,<br>
&gt; map.getProjectionObject());<br>
&gt;     layer.redraw();<br>
&gt; });<br>
<br>
</div>Yes.<br>
<div class="im"><br>
&gt;<br>
&gt; 2. I have a WKT parser object. It need to reproject the features based<br>
&gt; on the current base layer. Can I change the internalProjection on base<br>
&gt; layer change like:<br>
&gt;<br>
&gt; parser.internalProjection = map.getProjectionObject();<br>
<br>
</div>That should work.<br>
<br>
-- Chris<br>
<div><div></div><div class="h5"><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br>