OpenLayers OpenLayers

Changeset 346

Show
Ignore:
Timestamp:
05/24/06 22:09:33 (3 years ago)
Author:
euzuro
Message:

Since popups have a reference back to map, allow them to determine where they should be drawn internally. Thus we can remove the computing from the addPopup() function in Map.js.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Map.js

    r335 r346  
    173173        popup.map = this; 
    174174        this.popups.push(popup); 
    175         var px = this.getLayerPxFromLonLat(popup.lonlat) 
    176         var popupDiv = popup.draw(px); 
     175        var popupDiv = popup.draw(); 
    177176        if (popupDiv) { 
    178177            popupDiv.style.zIndex = this.Z_INDEX_BASE['Popup'] + 
  • trunk/openlayers/lib/OpenLayers/Popup.js

    r339 r346  
    8282    */ 
    8383    draw: function(px) { 
     84        if ((px == null) && (this.map != null)) { 
     85            px = this.map.getLayerPxFromLonLat(this.lonlat); 
     86        } 
     87         
    8488        if (this.div == null) { 
    8589            this.div = OpenLayers.Util.createDiv(this.id + "_div", 
  • trunk/openlayers/lib/OpenLayers/Popup/Anchored.js

    r343 r346  
    4040    */ 
    4141    draw: function(px) { 
     42        if ((px == null) && (this.map != null)) { 
     43            px = this.map.getLayerPxFromLonLat(this.lonlat); 
     44        } 
    4245         
    4346        //calculate relative position