I have a popup that I’m declaring like so in OpenLayers:
var feature = new O[penLayers.Feature(markers, lonLat);
feature.popupClass = OpenLayers.Class(OpenLayers.Popup.FramedCloud, {
'autoSize': true;
'maxSize': new OpenLayers.Size(500, 300)
});
The issue is that the multiple popups on my map are being created with consecutive z-indexes, so the popups will always be shown in the order the markers were added, with the popup of the most recent marker always being on top.
Is there a way to change it so that the most recently-clicked marker popup is on top, instead of that of the most recently-added marker? I’ve tried manually changing the z-index in firebug (as a test) but it doesn’t bring it to the front. I’d rather avoid deleting and remaking the popup or marker, but it seems to be the only solution I can find.
I couldn’t figure out how to reliably change the z-index and have it work, but I was able to solve my problem by completely removing and then creating a new clone of the map marker when I wanted it in the front.