Custom markers in webapps

I’ve been playing around with using OSM in webapps and have so far failed miserably with adding custom markers to the maps. An example is posted here: http://pastebin.com/m1f056671

It correctly shows the map centered on the specified locaton, however it never shows the marker and I also don’t find him anywhere else on the map. I’ve tried several things with the marker coordinate (passing unconverted coords, mercator converted coords and what now) but it never showed up.

Could someone please give me a heads up on that one? Either by telling what might be wrong with my code or by pointing to a site that already uses these markers?

I’ve tried the POI example from the wiki locally, but I’m not seeing the markers there, either.

I think you need to add

projection: new OpenLayers.Projection("EPSG:4326")

To the marker layer definition.

Working example here: http://tile.openstreetmap.nl/~lambertus/routing-world/

Thanks for your reply. Your line alone didn’t solve the problem for me (but it might be that the coordinate calculations need to be different with another projection). I’ve discovered that adding:

maxResolution: 15643.0399

to the marker layer definition solves the problem in my case (the rest of the code stays the same). I’ve a vague idea why it solves it but honestly I think that this stuff needs some more documentation. I hope that after completing this project my knowledge is solid enough to contribute.

Care to elaborate on ‘this project’? :slight_smile: