OK, I think I start to understad.<br><br>I modify my code like this (with spherical mercatro proyection in googlelayer, were I think it's ok)<br>And change the code of EPSG code for my layer.<br>Now my code it's:<br>
<br> <script type="text/javascript"><br><br> // make map available for easy debugging<br> var map;<br><br> // avoid pink tiles<br> OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;<br>
OpenLayers.Util.onImageLoadErrorColor = "transparent";<br><br><br> function init(){<br> var options = {numZoomLevels: 20,<br> projection: new OpenLayers.Projection("EPSG:900913"),<br>
displayProjection: new OpenLayers.Projection("EPSG:4326")};<br> <br> // Create a map Object<br> map = new OpenLayers.Map('map', options);<br><br> // Create Google Mercator layers<br>
var gmap = new OpenLayers.Layer.Google("Google Streets",{type: G_NORMAL_MAP,"sphericalMercator": true});<br> var gsat = new OpenLayers.Layer.Google("Google Satellite",{type: G_SATELLITE_MAP,"sphericalMercator": true});<br>
var ghyb = new OpenLayers.Layer.Google("Google Hybrid",{type: G_HYBRID_MAP,"sphericalMercator": true});<br> var gphy = new OpenLayers.Layer.Google("Google Physical",{type: G_PHYSICAL_MAP,"sphericalMercator": true}); <br>
// Create a WFS Sites Layer<br> var sites = new OpenLayers.Layer.WFS( "Sites",<br> "<a href="http://10.192.160.133/cgi-bin/mapserv.exe?map=/ms4w/apps/Test/WFS_Test.map">http://10.192.160.133/cgi-bin/mapserv.exe?map=/ms4w/apps/Test/WFS_Test.map</a>",<br>
{typename: "Sites",maxfeatures: 100 },{<br> featureClass: OpenLayers.Feature.WFS<br> });<br><br> map.addLayer(new OpenLayers.Layer.GML("GML",<br> "<a href="http://10.192.160.133/OpenLayers/ngo9_wgs84_01meu_cables_lille32.gml">http://10.192.160.133/OpenLayers/ngo9_wgs84_01meu_cables_lille32.gml</a>",<br>
{format: OpenLayers.Format.GML,<br> formatOptions: {<br> extractStyles: true, <br> extractAttributes: true},<br> projection: new OpenLayers.Projection("EPSG:4326")}<br>
)<br> );<br><br> map.addLayers([gmap,gsat,ghyb,gphy,sites]);<br> map.addControl(new OpenLayers.Control.LayerSwitcher());<br> map.addControl(new OpenLayers.Control.ScaleLine);<br>
map.addControl(new OpenLayers.Control.MousePosition());<br> if (!map.getCenter()) {map.zoomToMaxExtent()}<br> }<br><br> function changezoom(x,y,z)<br> {<br> map.setCenter(new OpenLayers.LonLat(x, y), z);<br>
} <br> function showAddress(address) {<br> var geocoder = new GClientGeocoder();<br> if (geocoder) {<br> geocoder.getLatLng(<br> address,<br> function(point) {<br> if (!point) {alert(address + " not found");}<br>
else {map.setCenter(new OpenLayers.LonLat(point.x,point.y),15);}});}}<br><br><br><br>And I have new problems :S! <br>1 the scale or units in my gml and wfs layers are wrong. (normaly my points an lines must be in france, and i show it in the midle of atlantic ocean, in a very small zoom (google don't have images for this area :S)<br>
I try to define units: "m" and units:"dd". But that don't works.<br><br>The answer for gml layer gives the correct lat lon wgs84 coordinates for lines, but I dont show it :S<br><br>Thanks for your patient and your help!<br>
<br><br><br><div class="gmail_quote">2008/6/26 Eric Lemoine <<a href="mailto:eric.c2c@gmail.com">eric.c2c@gmail.com</a>>:<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="Ih2E3d">On Thu, Jun 26, 2008 at 4:48 PM, Christopher Schmidt<br>
<<a href="mailto:crschmidt@metacarta.com">crschmidt@metacarta.com</a>> wrote:<br>
> On Thu, Jun 26, 2008 at 03:20:45PM +0200, David Martinez Morata wrote:<br>
>> Hy list, I start With OL " dais ago :S and I don't know javascript :SS!!<br>
>> But I start to developing some simple application... And at the first time<br>
>> was easy to start (copy paste the code)...<br>
>> But now I have some problems with a gml layer, and I have the impression tha<br>
>> OL it's not more stable (maybe because I don't know javascript)...<br>
>> It's my 5 or 6 email to the list asking for a the same question. Problem<br>
>> with GML layer pan, they change the coordinates?!!!<br>
>> I start to play with projections and now the problem it's bigger.<br>
>> When I change the base layer... the map changes too!!!<br>
><br>
> You didn't follow the instructions previously given to you in email,<br>
> of moving the spherical mercator option into the correct place in your<br>
> GOogle Layer init. Until you do this, you will continue to have<br>
> problems.<br>
<br>
</div>The same comment applies to the options passed to the GML object<br>
constructor - the 'projection' option must be in the same same object<br>
as the 'format' and 'formatOptions' options. Moreover, you certainly<br>
want to use EPSG:4326 rather than EPSG:4623!<br>
<br>
Regards,<br>
--<br>
<font color="#888888">Eric<br>
</font></blockquote></div><br>