Thanks, but now my layer is shifted in South Africa!!!<br><br>I don't understand what's wrong: the map output the exact coordinates.<br>Well, I've:<br>3 base layers -> epsg:900913<br>1 gml layer -> epsg:2498<br>
and I want display projection in wgs84<br><br>Is my set up (code in my previous mail) correct?<br><br>-beppe-<br><br><br><div class="gmail_quote">2010/4/7 <span dir="ltr"><<a href="mailto:bartvde@osgis.nl">bartvde@osgis.nl</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
<br>
not sure if this is the cause of your problem since I don't know anything<br>
about EPSG:2498, but can you try adding xy false to your Format.GML:<br>
<div class="im"><br>
var isoline = new OpenLayers.Layer.Vector("isoline", {<br>
strategies: [new OpenLayers.Strategy.Fixed()],<br>
protocol: new OpenLayers.Protocol.HTTP({<br>
url: "../aramus_data/vector/gml/isoipse_2498.gml",<br>
projection: epsg2498,<br>
</div> format: new OpenLayers.Format.GML({xy: false})<br>
})<br>
});<br>
<br>
Best regards,<br>
Bart<br>
<div><div></div><div class="h5"><br>
> Hi all,<br>
> I ought to display a map with osm layer as base and a gml file of a little<br>
> part of Armenia.<br>
> First step was convert my shapefile, with projection epsg:2498, in a gml<br>
> format (ogr2ogr -f GML ...).<br>
><br>
> Second step was set up my map.<br>
> Within tag <head> of my html page, I' ve insert a link to these libraries:<br>
><br>
> - OpenLayers-2.8/OpenLayers.js<br>
> - <a href="http://www.openstreetmap.org/openlayers/OpenStreetMap.js" target="_blank">http://www.openstreetmap.org/openlayers/OpenStreetMap.js</a><br>
> - proj4js.js<br>
> - proj4s/lib/defs/EPSG2498.js<br>
><br>
> And this is a snippet of my map code [1].<br>
><br>
> The problem is that my gml is in the north of Africa instead of Armenia.<br>
> I've tried with qgis and the layer is correctly positioned, so I suppose<br>
> that the problem is in the code, but I' m not able to detect the bug!!!<br>
><br>
> thanks<br>
><br>
> -beppe -<br>
><br>
> [1] function init() {<br>
> var epsg2498= new OpenLayers.Projection("EPSG:2498");<br>
> var epsg900913= new OpenLayers.Projection("EPSG:900913");<br>
> var epsg4326= new OpenLayers.Projection("EPSG:4326");<br>
><br>
> var bounds = new OpenLayers.Bounds(44.532, 40.144, 45.038,<br>
> 40.423).transform(epsg4326, epsg900913);<br>
><br>
> map = new OpenLayers.Map ("map", {<br>
> controls:[<br>
> new OpenLayers.Control.Navigation(),<br>
> new OpenLayers.Control.LayerSwitcher({activeColor:"#729aa1"}),<br>
> new<br>
> OpenLayers.Control.MousePosition({div:document.getElementById("coord")}),<br>
> new OpenLayers.Control.Attribution()],<br>
><br>
> maxExtent: bounds,<br>
> maxResolution: 156543.0399,<br>
> numZoomLevels: 5,<br>
> minZoomLevel: 3,<br>
> maxZoomLevel: 8,<br>
> units: 'm',<br>
> projection: epsg900913,<br>
> displayProjection: epsg2498<br>
> } );<br>
><br>
><br>
> var layerCycleMap = new OpenLayers.Layer.OSM.CycleMap("CycleMap");<br>
> map.addLayer(layerCycleMap);<br>
><br>
> var layerTilesAtHome = new<br>
> OpenLayers.Layer.OSM.Osmarender("Osmarender");<br>
> map.addLayer(layerTilesAtHome);<br>
><br>
> var layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik");<br>
> map.addLayer(layerMapnik);<br>
><br>
> var isoline = new OpenLayers.Layer.Vector("isoline", {<br>
> strategies: [new OpenLayers.Strategy.Fixed()],<br>
> protocol: new OpenLayers.Protocol.HTTP({<br>
> url: "../aramus_data/vector/gml/isoipse_2498.gml",<br>
> projection: epsg2498,<br>
> format: new OpenLayers.Format.GML()<br>
> })<br>
> });<br>
> isoline = OpenLayers.Projection.transform(isoline, epsg2498,<br>
> map.projection);<br>
> map.addLayer(isoline);<br>
> ....<br>
> ....<br>
> ....<br>
> --<br>
> -beppe-<br>
</div></div>> _______________________________________________<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>
><br>
<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>-beppe-<br>