var OnMapCreated = function(map) { // MarkerOverlay is the id for your SimpleMarkerOverlay var markerOverlay = map.getLayer('MarkerOverlay'); for (var i in markerOverlay.markers) { var marker = markerOverlay.markers[i]; marker.events.register('click', marker, function(evt) { var id = this.id; // Add your popup like the code below: //var popup = new OpenLayers.Popup.FramedCloud(); //map.addPopup(popup); }); } }
If you still have any questions about it please feel free to let us know.