]> dev.renevier.net Git - syp.git/blobdiff - js/syp.js
option to show popup near marker
[syp.git] / js / syp.js
index cf92ef51f9601ba8fa48478b62f51467736e4109..2c87c2b34bb83b64ae8fe784d9558f2343d519d8 100644 (file)
--- 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);