// max size (either width or height) of thumbnails. If one dimension of
// uploaded image is bigger, images will be resized.
define ("THUMBSMAXSIZE", 400);
+
+// if set to 0 (default), popup will appear at bottom right corner of the map.
+// If set to 1 or true, popup will appear near marker.
+define ("POPUPNEARFEATURE", 0);
?>
<?php
printf ("var sypOrig = [%.18F, %.18F, %.18F, %.18F];\n",
$bbox [0], $bbox [1], $bbox [2], $bbox [3]);
+
+ if (defined ("POPUPNEARFEATURE") && (POPUPNEARFEATURE)) {
+ printf ("var sypPopupNearFeature = true;\n");
+ } else {
+ printf ("var sypPopupNearFeature = false;\n");
+ }
?>
</script>
<script src="./openlayers/OpenLayers.js" type="text/javascript"></script>
}
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.
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);