OpenLayers OpenLayers

Changeset 3098

Show
Ignore:
Timestamp:
04/26/07 19:29:10 (2 years ago)
Author:
euzuro
Message:

fix for #681 - Make sure markers layer always draws on the first moveTo(), regardless of the value of 'zoomChanged'.

Files:

Legend:

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

    r1721 r3098  
    2222    * @type Array(OpenLayers.Marker) */ 
    2323    markers: null, 
     24 
     25 
     26    /** internal state of drawing. This is a workaround for the fact 
     27     *  that the map does not call moveTo with a zoomChanged when the 
     28     *  map is first starting up. This lets us catch the case where we 
     29     *  have *never* drawn the layer, and draw it even if the zoom hasn't 
     30     *  changed.  
     31     * @type Boolean */ 
     32    drawn: false, 
    2433     
    2534    /** 
     
    5261        OpenLayers.Layer.prototype.moveTo.apply(this, arguments); 
    5362 
    54         if (zoomChanged) { 
     63        if (zoomChanged || !this.drawn) { 
    5564            this.redraw(); 
     65            this.drawn = true; 
    5666        } 
    5767    },