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
This commit is contained in:
euzuro
2006-05-25 02:24:48 +00:00
parent 53f59f25ea
commit 79295569a3
2 changed files with 8 additions and 4 deletions
+3 -1
View File
@@ -81,9 +81,11 @@ OpenLayers.Popup.prototype = {
* @type DOMElement * @type DOMElement
*/ */
draw: function(px) { draw: function(px) {
if ((px == null) && (this.map != null)) { if (px == null) {
if ((this.lonlat != null) && (this.map != null)) {
px = this.map.getLayerPxFromLonLat(this.lonlat); px = this.map.getLayerPxFromLonLat(this.lonlat);
} }
}
if (this.div == null) { if (this.div == null) {
this.div = OpenLayers.Util.createDiv(this.id + "_div", this.div = OpenLayers.Util.createDiv(this.id + "_div",
+3 -1
View File
@@ -39,9 +39,11 @@ OpenLayers.Popup.Anchored.prototype =
* @type DOMElement * @type DOMElement
*/ */
draw: function(px) { draw: function(px) {
if ((px == null) && (this.map != null)) { if (px == null) {
if ((this.lonlat != null) && (this.map != null)) {
px = this.map.getLayerPxFromLonLat(this.lonlat); px = this.map.getLayerPxFromLonLat(this.lonlat);
} }
}
//calculate relative position //calculate relative position
this.relativePosition = this.calculateRelativePosition(px); this.relativePosition = this.calculateRelativePosition(px);