Adding support for new generation 'framed' popups. This patch includes numerous improvements to the main popups, including the addition of autoSizing, panIntoView, and full support for overflow:auto of the contents div. Thanks go out to the CloudAmber folks, to Pierre in la belle France, to the guys at TOPP and of course, to senior cr5 for his patience and help in the last and final stretch. this is a huge improvement in the popup arena and couldn't have been done without the broad help of everyone out there in the community. Thank you everyone for making this possible. Big step for OpenLayers. (Closes #926)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6718 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -38,6 +38,11 @@ OpenLayers.Popup.AnchoredBubble =
|
||||
*/
|
||||
initialize:function(id, lonlat, size, contentHTML, anchor, closeBox,
|
||||
closeBoxCallback) {
|
||||
|
||||
this.padding = new OpenLayers.Bounds(
|
||||
0, OpenLayers.Popup.AnchoredBubble.CORNER_SIZE,
|
||||
0, OpenLayers.Popup.AnchoredBubble.CORNER_SIZE
|
||||
);
|
||||
OpenLayers.Popup.Anchored.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
||||
@@ -64,17 +69,12 @@ OpenLayers.Popup.AnchoredBubble =
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: moveTo
|
||||
* The popup may have been moved to a new relative location, in which case
|
||||
* Method: updateRelativePosition
|
||||
* The popup has been moved to a new relative location, in which case
|
||||
* we will want to re-do the rico corners.
|
||||
*
|
||||
* Parameters:
|
||||
* px - {<OpenLayers.Pixel>}
|
||||
*/
|
||||
moveTo: function(px) {
|
||||
OpenLayers.Popup.Anchored.prototype.moveTo.apply(this, arguments);
|
||||
this.setRicoCorners(!this.rounded);
|
||||
this.rounded = true;
|
||||
updateRelativePosition: function() {
|
||||
this.setRicoCorners();
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -85,22 +85,8 @@ OpenLayers.Popup.AnchoredBubble =
|
||||
*/
|
||||
setSize:function(size) {
|
||||
OpenLayers.Popup.Anchored.prototype.setSize.apply(this, arguments);
|
||||
|
||||
if (this.contentDiv != null) {
|
||||
|
||||
var contentSize = this.size.clone();
|
||||
contentSize.h -= (2 * OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);
|
||||
contentSize.h -= (2 * this.padding);
|
||||
|
||||
this.contentDiv.style.height = contentSize.h + "px";
|
||||
this.contentDiv.style.width = contentSize.w + "px";
|
||||
|
||||
if (this.map) {
|
||||
//size has changed - must redo corners
|
||||
this.setRicoCorners(!this.rounded);
|
||||
this.rounded = true;
|
||||
}
|
||||
}
|
||||
this.setRicoCorners();
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -117,7 +103,7 @@ OpenLayers.Popup.AnchoredBubble =
|
||||
if (this.div != null) {
|
||||
if (this.contentDiv != null) {
|
||||
this.div.style.background = "transparent";
|
||||
OpenLayers.Rico.Corner.changeColor(this.contentDiv,
|
||||
OpenLayers.Rico.Corner.changeColor(this.groupDiv,
|
||||
this.backgroundColor);
|
||||
}
|
||||
}
|
||||
@@ -154,11 +140,8 @@ OpenLayers.Popup.AnchoredBubble =
|
||||
/**
|
||||
* Method: setRicoCorners
|
||||
* Update RICO corners according to the popup's current relative postion.
|
||||
*
|
||||
* Parameters:
|
||||
* firstTime - {Boolean} This the first time the corners are being rounded.
|
||||
*/
|
||||
setRicoCorners:function(firstTime) {
|
||||
setRicoCorners:function() {
|
||||
|
||||
var corners = this.getCornersToRound(this.relativePosition);
|
||||
var options = {corners: corners,
|
||||
@@ -166,8 +149,9 @@ OpenLayers.Popup.AnchoredBubble =
|
||||
bgColor: "transparent",
|
||||
blend: false};
|
||||
|
||||
if (firstTime) {
|
||||
if (!this.rounded) {
|
||||
OpenLayers.Rico.Corner.round(this.div, options);
|
||||
this.rounded = true;
|
||||
} else {
|
||||
OpenLayers.Rico.Corner.reRound(this.groupDiv, options);
|
||||
//set the popup color and opacity
|
||||
|
||||
Reference in New Issue
Block a user