Ciao a tutti,<br>ho un problema di proiezione tra un layer OSM e un wfs proveniente da Geoserver. Il tutto č visualizzato in un MapPanel di GeoExt.<br>Il problema č che mentre OSM č puntato sulla zona giusta (Napoli) i punti si trovano sovrapposti di fronte all'Africa!! <br>
Vi posto un po' di codice,se qualcuno puņ darci uno sguardo,gli sarei molto grato :<br><br><br> Ext.onReady(function(){<br> <br> var lat=40.85000;<br> var lon=14.25622;<br> var zoom=14;<br>
<br> var map = new OpenLayers.Map ("map", {<br><br> maxExtent: new OpenLayers.Bounds(-19602834.611,-6328326.120,19259229.394,15761277.666),<br> <br> maxResolution: 156543.0399,<br>
<br> units: 'm',<br> projection: new OpenLayers.Projection("EPSG:900913"),<br> <br> displayProjection: new OpenLayers.Projection("EPSG:4326")<br>
});<br> <br> var openstreetmap = new OpenLayers.Layer.OSM();<br> <br><br> var vecLayer = new OpenLayers.Layer.Vector("vector");<br> map.addLayers([openstreetmap,vecLayer]);<br>
<br> // create feature store, binding it to the vector layer<br> var store = new GeoExt.data.FeatureStore({<br> layer: vecLayer,<br> fields: [<br> {name: 'id', type: 'integer'},<br>
<br> ],<br> proxy: new GeoExt.data.ProtocolProxy({<br> protocol: new OpenLayers.Protocol.WFS({<br> url: "<a href="http://localhost/proxy.php?url=http://odata.it:8080/geoserver/wfs">http://localhost/proxy.php?url=http://odata.it:8080/geoserver/wfs</a>",<br>
featureType: "prova",<br> featureNS: "<a href="http://www.openplans.org/topp">http://www.openplans.org/topp</a>",<br> srs: 'EPSG:4326',<br>
geometryName: "the_geom",<br> schema: "<a href="http://localhost/proxy.php?url=http://localhost/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=topp:prova">http://localhost/proxy.php?url=http://localhost/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=topp:prova</a>"<br>
<br><br><br> /* new OpenLayers.Protocol.HTTP({<br> url: "store.json",<br> format: new OpenLayers.Format.GeoJSON()*/<br> })<br> }),<br> autoLoad: true<br>
});<br><br><br> var mapPanel= new GeoExt.MapPanel({<br> renderTo:'mainpanel',<br> height: 300,<br> width: 950,<br> map: map,<br> center:new OpenLayers.LonLat( lon ,lat ).transform( new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()),<br>
zoom:13,<br> title: 'Mappa '<br> });<br><br>Cordiali Saluti,Nicola.<br>