diff --git a/lib/OpenLayers/Popup/Anchored.js b/lib/OpenLayers/Popup/Anchored.js index 1c6023a6f0..3c3009adc0 100644 --- a/lib/OpenLayers/Popup/Anchored.js +++ b/lib/OpenLayers/Popup/Anchored.js @@ -91,11 +91,15 @@ OpenLayers.Popup.Anchored = /** * Method: moveTo + * Since the popup is moving to a new px, it might need also to be moved + * relative to where the marker is. * * Parameters: * px - {} */ moveTo: function(px) { + this.relativePosition = this.calculateRelativePosition(px); + var newPx = this.calculateNewPx(px); var newArguments = new Array(newPx); diff --git a/lib/OpenLayers/Popup/AnchoredBubble.js b/lib/OpenLayers/Popup/AnchoredBubble.js index 478a953785..ae3ee3eb42 100644 --- a/lib/OpenLayers/Popup/AnchoredBubble.js +++ b/lib/OpenLayers/Popup/AnchoredBubble.js @@ -52,9 +52,6 @@ OpenLayers.Popup.AnchoredBubble = this.setContentHTML(); - this.setRicoCorners(!this.rounded); - this.rounded = true; - //set the popup color and opacity this.setBackgroundColor(); this.setOpacity(); @@ -62,6 +59,20 @@ OpenLayers.Popup.AnchoredBubble = return this.div; }, + /** + * Method: moveTo + * The popup may have been moved to a new relative location, in which case + * we will want to re-do the rico corners. + * + * Parameters: + * px - {} + */ + moveTo: function(px) { + OpenLayers.Popup.Anchored.prototype.moveTo.apply(this, arguments); + this.setRicoCorners(!this.rounded); + this.rounded = true; + }, + /** * APIMethod: setSize * diff --git a/tests/Popup/test_Anchored.html b/tests/Popup/test_Anchored.html new file mode 100644 index 0000000000..f87a1dc1aa --- /dev/null +++ b/tests/Popup/test_Anchored.html @@ -0,0 +1,37 @@ + + + + + + + + diff --git a/tests/list-tests.html b/tests/list-tests.html index c54630d1d8..834a4cc5ea 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -31,6 +31,7 @@
  • test_Marker.html
  • Marker/test_Box.html
  • test_Popup.html
  • +
  • Popup/test_Anchored.html
  • test_Feature.html
  • Feature/test_Vector.html
  • test_Events.html