popup actually can use 'parentNode' to determine his parent. so no need to set anything. also, only try removing from viewPortDiv if popup.div is not null
git-svn-id: http://svn.openlayers.org/trunk/openlayers@231 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -151,7 +151,6 @@ OpenLayers.Map.prototype = {
|
|||||||
* @param {OpenLayers.Popup} popup
|
* @param {OpenLayers.Popup} popup
|
||||||
*/
|
*/
|
||||||
addPopup: function(popup) {
|
addPopup: function(popup) {
|
||||||
popup.parent = this.viewPortDiv;
|
|
||||||
this.popups.push(popup);
|
this.popups.push(popup);
|
||||||
var popupDiv = popup.draw();
|
var popupDiv = popup.draw();
|
||||||
if (popupDiv) {
|
if (popupDiv) {
|
||||||
@@ -166,9 +165,11 @@ OpenLayers.Map.prototype = {
|
|||||||
*/
|
*/
|
||||||
removePopup: function(popup) {
|
removePopup: function(popup) {
|
||||||
this.popups.remove(popup);
|
this.popups.remove(popup);
|
||||||
this.viewPortDiv.removeChild(popup.div);
|
if (popup.div) {
|
||||||
|
this.viewPortDiv.removeChild(popup.div);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {float}
|
* @return {float}
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user