OpenLayers Permalinks to work at OSM Chile

Some time ago I installed OpenLayers in the OpenStreetMap Chile website (http://www.openstreetmap.cl/). The problem is that I have not been able to make the Edit Permalink work. As Jochen Topf indicated to me, the problem is probably related with the Projection configured in OL.

The main problem with this is that my JavaScript knowledge is pretty near to zero. So even though I have tried a couple of changes in the projection and units variables in the http://www.openstreetmap.cl/index.html and http://www.openstreetmap.cl/OpenLayers.js files, I have not achieved anything.

Do you see anything wrong with those files?

The keywords are ‘displayprojection’ and ‘projection’. See the OpenLayers examples in the wiki, like the Simple example
:

Include the openstreetmap OL file:

Then create the map using the correct projections:

Then you can define your layers, like the standard OpenStreetMap mapnik layer:

oh! Thanks Lambertus this explanation was really needed

the “Openlayers mercator coordinates instead of GPS coordinates” problem is common when using Open layers. It really sucks not having WGS84 coordinates (GPS coordinates) in Openlayers.

PS the meaning of this post was to provide interesting keywords DS…

EPSG:900913 is Google projection is spherical Mercator projection and WGS84 is EPSG:4326 :slight_smile:

http://trac.openlayers.org/wiki/SphericalMercator
http://spatialreference.org/ref/epsg/4326/

So, afaik, what happens is that you have data in the Google projection and wish to view it in a WGS84 projection. That is what the ‘projection’ and ‘displayprojection’ settings are for…

I can not use the OpenLayers.js file directly from the OpenStreetMap or OpenLayers website, since I changed the image and position of the buttons. to fit the website design. If you know how to use the external file and change those variables at the same time, please let me know.

Thanks

It’s faster for your users if you use a local copy.

I do not have any problem in using the local or remote files, as long as everything works the way I want. I know there are some Pros and Cons for each method, but again, the most important thing for my is that every link in the site works the right way (bringing the Map, the Blog, the Comparison System, the Wiki, and the Edit interface to the people).

I have to admit that I have the bad habit (since I am not a programmer or engineer) of taking pieces of code from other sites, editing and testing it until it works. But that probably has added a lot of unnecessary code to this website.

If someone is willing to take a look at the code behind the scene and tell me if he/she sees something wrong or unused, I will be waiting for your comments. Also if you see a way of making work both the Permalink (It works now) and the Edit permalink, that will help me a lot.

Thanks