X-Git-Url: https://dev.renevier.net/gitweb.cgi?p=syp.git;a=blobdiff_plain;f=js%2Fsyp.js;fp=js%2Fsyp.js;h=2c87c2b34bb83b64ae8fe784d9558f2343d519d8;hp=cf92ef51f9601ba8fa48478b62f51467736e4109;hb=12376baf148afee289fbb53dd16ee2a0841d5290;hpb=1cc7e39c1d097ef3a95aef04552a34f360723e6d diff --git a/js/syp.js b/js/syp.js index cf92ef5..2c87c2b 100644 --- a/js/syp.js +++ b/js/syp.js @@ -169,7 +169,12 @@ var SYP = { } var popup = feature.popup; - var brCorner = SYP.Utils.brCorner(map, 8); + var popupPos = null; + if (sypPopupNearFeature) { + popupPos = feature.geometry.getBounds().getCenterLonLat(); + } else { + popupPos = SYP.Utils.brCorner(map, 8); + } // we cannot reuse popup; we need to recreate it in order for IE // expressions to work. Otherwise, we get a 0x0 image on second view. @@ -189,7 +194,7 @@ var SYP = { this.map.events.register("movestart", this, this._unselect = function () { this.unselect(feature)}); return; } - popup = SYP.createPopup(brCorner, contentHTML); + popup = SYP.createPopup(popupPos, contentHTML); var control = this; popup.hide = function () { OpenLayers.Element.hide(this.div);