Javascript – Openstreetmap: embedding map in webpage (like Google Maps)


Is there a way to embed/mashup the OpenStreetMap in your page (like the way Google Maps API works)?

I need to show a map inside my page with some markers and allow dragging/zooming around, maybe routing.
I suspect there would be some Javascript API for this, but I can't seem to find it.

Searching gets me an API for access to raw map data, but that seems to be more for map editing; besides, working with that would be a heavy task for AJAX.

Best Solution

You need to use some JavaScript stuff to show your map. OpenLayers is the number one choice for this.

There is an example at and something more advanced at


Related Question