Hello!<div><br></div><div>Sorry for the late reply! </div><div>Thanks for the link to the "spherical mercator" documentation, that helped me to understand the underlying problem.</div><div><br></div><div>With </div>

<div><br></div><div><div>var geojson_format = new OpenLayers.Format.GeoJSON({</div><div>            'internalProjection': new OpenLayers.Projection("EPSG:900913"),</div><div>            'externalProjection': new OpenLayers.Projection("EPSG:4326")</div>

<div>        });</div><div><br></div><div>it was actually very easy to transform the json-data to the required projection.</div><div><br></div><div>Best regards,</div><div>Christian</div><div><br></div><div class="gmail_quote">

On 31 July 2012 23:36, Thomas Gratier <span dir="ltr"><<a href="mailto:osgeo.mailinglist@gmail.com" target="_blank">osgeo.mailinglist@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hello,<br><br>It's because when you're using tiles from OSM, the projection is 900913 (Google Spherical Mercator) and on WMS it is 4326.<br>You json is in the same projection althought your map are not in the same projection and overlays fail because of this.<br>



<br>Do in you javascript debugger map.getProjection() on the example <a href="http://poab.org/openlayers/geojson_osm.html" target="_blank">http://poab.org/openlayers/geojson_osm.html</a><br>You get <span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;color:rgb(196,26,22);text-transform:none;font-size:11px;white-space:pre-wrap;font-family:'dejavu sans mono',monospace;word-spacing:0px">EPSG:900913<br>



</span>On your other example e.g <a href="http://poab.org/openlayers/geojson_wms.html" target="_blank">http://poab.org/openlayers/geojson_wms.html</a>, the same command give you <span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:11px;white-space:pre-wrap;font-family:'dejavu sans mono',monospace;word-spacing:0px"></span><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;color:rgb(196,26,22);text-transform:none;font-size:11px;white-space:pre-wrap;font-family:'dejavu sans mono',monospace;word-spacing:0px">EPSG:4326</span><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:11px;white-space:pre-wrap;font-family:'dejavu sans mono',monospace;word-spacing:0px"></span><br>



Refer to this page <a href="http://docs.openlayers.org/library/spherical_mercator.html" target="_blank">http://docs.openlayers.org/library/spherical_mercator.html</a> for further explanations you seem to miss <br><br>Regards<br>

<br>ThomasG<br>

<br><br> <span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;color:rgb(196,26,22);text-transform:none;font-size:11px;white-space:pre-wrap;font-family:'dejavu sans mono',monospace;word-spacing:0px"> <br>



</span><br><br><br><div class="gmail_quote">2012/7/31 Christian Benke <span dir="ltr"><<a href="mailto:benkokakao@gmail.com" target="_blank">benkokakao@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div class="h5">

Hello!<br>
<br>
I'm having difficulties to understand some basics of openlayers and<br>
projection. I'm trying to put tracks in geojson-format on a map. This<br>
works just fine with a WMS-Layer, but i seem to miss a crucial<br>
connection when trying to display it on an OSM-layer.<br>
<br>
I've tried to decipher the example at<br>
<a href="http://openlayers.org/dev/examples/fusiontables.html%28Which" target="_blank">http://openlayers.org/dev/examples/fusiontables.html(Which</a> uses<br>
GeoJSON on OSM) to adapt it to my needs, but as it is a lot more<br>
abstract than the very basic example-script i'm starting off, i get<br>
stuck even earlier when trying to change the geodata-source to my<br>
flatfile.<br>
<br>
Here is my basic example with WMS:<br>
<a href="http://poab.org/openlayers/geojson_wms.html" target="_blank">http://poab.org/openlayers/geojson_wms.html</a><br>
<br>
And here's the same, but the map-layer is of OSM:<br>
<a href="http://poab.org/openlayers/geojson_osm.html" target="_blank">http://poab.org/openlayers/geojson_osm.html</a><br>
<br>
On both maps i try to display GeoJSON-data from<br>
<a href="http://poab.org/openlayers/gpx2json.js" target="_blank">http://poab.org/openlayers/gpx2json.js</a>, with WMS this works fine, with<br>
OSM it doesn't.<br>
<br>
I guess the problem lies within the projection/transformation of the<br>
GeoJSON-data, but i'm having a hard time figuring out how this is<br>
supposed to work and why the tracks are not displayed at all(Or at<br>
least how i can get it to tell me errors while parsing, if there are<br>
any).<br>
Obviously the WMS-layer is displayed very differently than the<br>
OSM-layer, so i assume that the GeoJSON-data also has to be adapted to<br>
be OSM-projection so it can be displayed on top of it?<br>
<br>
A related question: Why does the OSM-Layer need to be transformed to a<br>
different projection for centering it, not just setCenter with lon,<br>
lat and zoom like WMS?<br>
<br>
These are probably very basic questions for an experienced user - i'm<br>
currently a bit overwhelmed by the amount of information to digest<br>
while trying to get a understanding of GIS - i ask for patience, i'll<br>
probably post a few more ignorant questions to this list in the next<br>
few weeks.<br>
<br>
Best regards,<br>
Christian<br></div></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</blockquote></div><br>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
<br></blockquote></div><br></div>