give Popup an 'updatePosition()' function that allows it to re-position itself. This will be used for zoom changes.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@350 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-25 02:43:56 +00:00
parent b036da46f5
commit bf8c1fba02
2 changed files with 12 additions and 3 deletions

View File

@@ -103,6 +103,17 @@ OpenLayers.Popup.prototype = {
return this.div;
},
/**
* if the popup has a lonlat and its map members set,
* then have it move itself to its proper position
*/
updatePosition: function() {
if ((this.lonlat) && (this.map)) {
px = this.map.getLayerPxFromLonLat(this.lonlat);
this.moveTo(px);
}
},
/**
* @param {OpenLayers.Pixel} px
*/