diff --git a/lib/OpenLayers/Popup/Anchored.js b/lib/OpenLayers/Popup/Anchored.js index 2ee59e9e75..543c3ec413 100644 --- a/lib/OpenLayers/Popup/Anchored.js +++ b/lib/OpenLayers/Popup/Anchored.js @@ -23,13 +23,11 @@ OpenLayers.Popup.Anchored.prototype = * @param {String} contentHTML */ initialize:function(id, lonlat, size, contentHTML, anchorSize) { - var newArguments = new Array(id, lonlat, size, contentHTML); OpenLayers.Popup.prototype.initialize.apply(this, newArguments); this.anchorSize = (anchorSize != null) ? anchorSize : new OpenLayers.Size(0,0); - }, /** @@ -102,14 +100,13 @@ OpenLayers.Popup.Anchored.prototype = * @type OpenLayers.Pixel */ calculateNewPx:function(px) { - var newPx = px.copyOf(); var top = (this.relativePosition.charAt(0) == 't'); - newPx.y += (top) ? -this.size.h : this.anchorSize.h; + newPx.y += (top) ? -(this.size.h + this.anchorSize.h) : this.anchorSize.h; var left = (this.relativePosition.charAt(1) == 'l'); - newPx.x += (left) ? -this.size.w : this.anchorSize.w; + newPx.x += (left) ? -(this.size.w + this.anchorSize.w) : this.anchorSize.w; return newPx; },