Changeset 6475
- Timestamp:
- 03/10/08 14:23:19 (10 months ago)
- Files:
-
- sandbox/euzuro/pop/examples/sundials.html (modified) (1 diff)
- sandbox/euzuro/pop/lib/OpenLayers/Popup/Framed.js (modified) (3 diffs)
- sandbox/euzuro/pop/lib/OpenLayers/Popup/FramedCloud.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/euzuro/pop/examples/sundials.html
r6420 r6475 43 43 function onFeatureSelect(feature) { 44 44 selectedFeature = feature; 45 var anchor = { 46 'size': new OpenLayers.Size(0,0), 47 'offset': new OpenLayers.Pixel(0,16) 48 }; 45 49 popup = new OpenLayers.Popup.FramedCloud("chicken", 46 50 feature.geometry.getBounds().getCenterLonLat(), 47 51 new OpenLayers.Size(100,100), 48 52 "<div style='font-size:.8em'>"+feature.attributes.description+"</div>", 49 {'size': new OpenLayers.Size(0,0), 'offset': new OpenLayers.Size(0,0)}, true, onPopupClose);50 feature.popup = popup;53 anchor, true, onPopupClose); 54 feature.popup = popup; 51 55 map.addPopup(popup); 52 56 } sandbox/euzuro/pop/lib/OpenLayers/Popup/Framed.js
r6406 r6475 89 89 closeBoxCallback) { 90 90 91 var newAnchor = null; 91 OpenLayers.Popup.Anchored.prototype.initialize.apply(this, arguments); 92 92 93 if (this.fixedRelativePosition) { 93 94 //based on our decided relativePostion, set the current padding 94 95 // this keeps us from getting into trouble 95 this.padding = this.positionBlocks[this.relativePosition].padding; 96 97 newAnchor = { 98 size: new OpenLayers.Size(0,0), 99 offset: this.positionBlocks[this.relativePosition].offset 100 }; 101 } 102 103 var newArgs = [ 104 id, lonlat, size, contentHTML, newAnchor, 105 closeBox, closeBoxCallback 106 ]; 107 OpenLayers.Popup.Anchored.prototype.initialize.apply(this, newArgs); 96 this.updateRelativePosition(this.relativePosition); 97 } 108 98 109 99 this.contentDiv.style.position = "absolute"; … … 239 229 */ 240 230 updateRelativePosition: function(relativePosition) { 241 //update the anchor offset242 this.anchor.offset = this.positionBlocks[relativePosition].offset;243 231 244 232 //update the padding … … 250 238 this.closeDiv.style.top = this.padding.top + "px"; 251 239 } 240 }, 241 242 /** 243 * Method: calculateNewPx 244 * 245 * Parameters: 246 * px - {<OpenLayers.Pixel>} 247 * 248 * Returns: 249 * {<OpenLayers.Pixel>} The the new px position of the popup on the screen 250 * relative to the passed-in px. 251 */ 252 calculateNewPx:function(px) { 253 var newPx = OpenLayers.Popup.Anchored.prototype.calculateNewPx.apply( 254 this, arguments 255 ); 256 257 newPx = newPx.offset(this.positionBlocks[this.relativePosition].offset); 258 259 return newPx; 252 260 }, 253 261 sandbox/euzuro/pop/lib/OpenLayers/Popup/FramedCloud.js
r6454 r6475 54 54 positionBlocks: { 55 55 "tl": { 56 'offset': new OpenLayers.Pixel( 55, -10),56 'offset': new OpenLayers.Pixel(61, 15), 57 57 'padding': new OpenLayers.Bounds(15, 75, 60, 15), 58 58 'blocks': [ … … 80 80 }, 81 81 "tr": { 82 'offset': new OpenLayers.Pixel(- 35, -10),82 'offset': new OpenLayers.Pixel(-45, 15), 83 83 'padding': new OpenLayers.Bounds(15, 75, 60, 15), 84 84 'blocks': [ … … 111 111 }, 112 112 "bl": { 113 'offset': new OpenLayers.Pixel( 55, 0),113 'offset': new OpenLayers.Pixel(61, -6), 114 114 'padding': new OpenLayers.Bounds(15, 45, 60, 53), 115 115 'blocks': [ … … 142 142 }, 143 143 "br": { 144 'offset': new OpenLayers.Pixel(- 35, 0),144 'offset': new OpenLayers.Pixel(-44, -6), 145 145 'padding': new OpenLayers.Bounds(15, 45, 60, 53), 146 146 'blocks': [
