From 79295569a3613b9779aa40d06c33b5d8e6c7e1a1 Mon Sep 17 00:00:00 2001 From: euzuro Date: Thu, 25 May 2006 02:24:48 +0000 Subject: [PATCH] we should really be sure that this.lonlat is set too. git-svn-id: http://svn.openlayers.org/trunk/openlayers@348 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Popup.js | 6 ++++-- lib/OpenLayers/Popup/Anchored.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/OpenLayers/Popup.js b/lib/OpenLayers/Popup.js index 1c2ca8b8af..56e56aea39 100644 --- a/lib/OpenLayers/Popup.js +++ b/lib/OpenLayers/Popup.js @@ -81,8 +81,10 @@ OpenLayers.Popup.prototype = { * @type DOMElement */ draw: function(px) { - if ((px == null) && (this.map != null)) { - px = this.map.getLayerPxFromLonLat(this.lonlat); + if (px == null) { + if ((this.lonlat != null) && (this.map != null)) { + px = this.map.getLayerPxFromLonLat(this.lonlat); + } } if (this.div == null) { diff --git a/lib/OpenLayers/Popup/Anchored.js b/lib/OpenLayers/Popup/Anchored.js index c27569a083..2ee59e9e75 100644 --- a/lib/OpenLayers/Popup/Anchored.js +++ b/lib/OpenLayers/Popup/Anchored.js @@ -39,8 +39,10 @@ OpenLayers.Popup.Anchored.prototype = * @type DOMElement */ draw: function(px) { - if ((px == null) && (this.map != null)) { - px = this.map.getLayerPxFromLonLat(this.lonlat); + if (px == null) { + if ((this.lonlat != null) && (this.map != null)) { + px = this.map.getLayerPxFromLonLat(this.lonlat); + } } //calculate relative position