allow an option to kill all other popups on addition of new one

git-svn-id: http://svn.openlayers.org/trunk/openlayers@1004 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-07-25 21:43:28 +00:00
parent 65da9e491e
commit 04a2e9472d

View File

@@ -357,8 +357,17 @@ OpenLayers.Map.prototype = {
/**
* @param {OpenLayers.Popup} popup
* @param {Boolean} exclusive If true, closes all other popups first
*/
addPopup: function(popup) {
addPopup: function(popup, exclusive) {
if (exclusive) {
//remove all other popups from screen
for(var i=0; i < this.popups.length; i++) {
this.removePopup(this.popups[i]);
}
}
popup.map = this;
this.popups.push(popup);
var popupDiv = popup.draw();