OpenLayers OpenLayers

Changeset 1503

Show
Ignore:
Timestamp:
09/26/06 17:46:10 (2 years ago)
Author:
euzuro
Message:

small cleanup of basic OpenLayers.Feature functionality -- specifically adding full control for popup and marker creation and destruction and better comments for all that. all tests pass.

Files:

Legend:

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

    r1497 r1503  
    6868        } 
    6969        if (this.popup != null) { 
    70             this.popup.destroy(); 
     70            this.destroyPopup(this.popup); 
    7171            this.popup = null; 
    7272        } 
     
    7777     * @returns A Marker Object created from the 'lonlat' and 'icon' properties 
    7878     *          set in this.data. If no 'lonlat' is set, returns null. If no 
    79      *          'icon' is set, OpenLayers.Marker() will load the default image 
     79     *          'icon' is set, OpenLayers.Marker() will load the default image. 
     80     *           
     81     *          Note: this.marker is set to return value 
     82     *  
    8083     * @type OpenLayers.Marker 
    8184     */ 
     
    9093    }, 
    9194 
     95    /** If user overrides the createMarker() function, s/he should be able 
     96     *   to also specify an alternative function for destroying it 
     97     */ 
    9298    destroyMarker: function() { 
    9399        this.marker.destroy();   
     
    95101 
    96102    /** 
     103     * @returns A Popup Object created from the 'lonlat', 'popupSize', 
     104     *          and 'popupContentHTML' properties set in this.data. It uses 
     105     *          this.marker.icon as default anchor.  
     106     *           
     107     *          If no 'lonlat' is set, returns null.  
     108     *          If no this.marker has been created, no anchor is sent. 
    97109     *  
     110     *          Note: this.popup is set to return value 
     111     *  
     112     * @type OpenLayers.Popup.AnchoredBubble 
    98113     */ 
    99114    createPopup: function() { 
     
    113128    }, 
    114129 
     130     
     131    /** As with the marker, if user overrides the createPopup() function, s/he  
     132     *   should also be able to override the destruction 
     133     */ 
     134    destroyPopup: function() { 
     135        this.popup.destroy()  
     136    }, 
     137     
    115138    CLASS_NAME: "OpenLayers.Feature" 
    116139};