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 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 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 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>
I don't understand anything:S this is the code i write:<br><br><pre id="line1"><span class="doctype"><!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN" <br> "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</a>"></span><br>
<<span class="start-tag">html</span><span class="attribute-name"> xmlns</span>=<span class="attribute-value">"<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>"</span>><br> <<span class="start-tag">head</span>><br>
        <<span class="start-tag">title</span>>Test OpenLayers</<span class="end-tag">title</span>><br> <<span class="start-tag">meta</span><span class="attribute-name"> http-equiv</span>=<span class="attribute-value">"content-type" </span><span class="attribute-name">content</span>=<span class="attribute-value">"text/html; charset=utf-8"</span><span class="error"><span class="attribute-name">/</span></span>><br>
<br> <<span class="start-tag">script</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text/javascript" </span><span class="attribute-name">src</span>=<span class="attribute-value">'<a href="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAu_VBBdBvqz5BLcs7nrzUXBTtRbNeTxVoAy20KSc4Ig34aflRRhQFn5FeqUpODActln3OKR2UQ_14vg">http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAu_VBBdBvqz5BLcs7nrzUXBTtRbNeTxVoAy20KSc4Ig34aflRRhQFn5FeqUpODActln3OKR2UQ_14vg</a>'</span>></<span class="end-tag">script</span>> <br>
<<span class="start-tag">script</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text/javascript" </span><span class="attribute-name">src</span>=<span class="attribute-value">"<a href="http://openlayers.org/api/OpenLayers.js">http://openlayers.org/api/OpenLayers.js</a>"</span>></<span class="end-tag">script</span>><br>
                <<span class="start-tag">script</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text/javascript"</span>><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:4623")};<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> 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:4623")}<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> </<span class="end-tag">script</span>><br></pre><pre id="line69"></<span class="end-tag">head</span>><br><<span class="start-tag">body</span><span class="attribute-name"> onload</span>=<span class="attribute-value">"init()"</span>><br>
<<span class="start-tag">div</span><span class="attribute-name"> id</span>=<span class="attribute-value">"header"</span>><br> <<span class="start-tag">h1</span><span class="attribute-name"> id</span>=<span class="attribute-value">"title"</span>>Test OpenLayers</<span class="end-tag">h1</span>><br>
<<span class="start-tag">form</span><span class="attribute-name"> action</span>=<span class="attribute-value">"#" </span><span class="attribute-name">onsubmit</span>=<span class="attribute-value">"showAddress(this.address.value, this.countrycode.value); return false" </span>><br>
                <<span class="start-tag">p</span>>Recherchez un adresse: <<span class="start-tag">input</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text" </span><span class="attribute-name">size</span>=<span class="attribute-value">"60" </span><span class="attribute-name">id</span>=<span class="attribute-value">"address" </span><span class="attribute-name">value</span>=<span class="attribute-value">"" </span><span class="error"><span class="attribute-name">/</span></span>><br>
        &<span class="entity">nbsp;</span> <<span class="start-tag">input</span><span class="attribute-name"> type</span>=<span class="attribute-value">"submit" </span><span class="attribute-name">onclick</span>=<span class="attribute-value">"showAddress(document.getElementById('address').value); return false;" </span><span class="attribute-name">value</span>=<span class="attribute-value">"Go!" </span><span class="error"><span class="attribute-name">/</span></span>><br>
        </<span class="end-tag">p</span>><br></pre><pre id="line77"> </<span class="end-tag">form</span>><br> </<span class="end-tag">div</span>><br> <<span class="start-tag">div</span><span class="attribute-name"> style</span>=<span class="attribute-value">"width:100%; height:85%" </span><span class="attribute-name">id</span>=<span class="attribute-value">"map"</span>></<span class="end-tag">div</span>><br>
<<span class="start-tag">div</span><span class="attribute-name"> id</span>=<span class="attribute-value">"docs"</span>><br>         </<span class="end-tag">div</span>><br></<span class="end-tag">body</span>><br>
</<span class="end-tag">html</span>></pre>And I don't know Wat to do... <br>PLeeeeeeeeeeeeaaaaseeeeee help me!<br><br>Thanks a lot for your patience!<br>