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="color:rgb(196,26,22);font-family:'dejavu sans mono',monospace;font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none">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="color:rgb(0,0,0);font-family:'dejavu sans mono',monospace;font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none"></span><span class="console-formatted-string source-code" style="color:rgb(196,26,22);white-space:pre-wrap;font-family:'dejavu sans mono',monospace;font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255)">EPSG:4326</span><span style="color:rgb(0,0,0);font-family:'dejavu sans mono',monospace;font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none"></span><br>

Refer to this page <a href="http://docs.openlayers.org/library/spherical_mercator.html">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="color:rgb(196,26,22);font-family:'dejavu sans mono',monospace;font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none"> <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">

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>
_______________________________________________<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>
</blockquote></div><br>