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

git-svn-id: http://svn.openlayers.org/trunk/openlayers@3098 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2007-04-26 23:29:10 +00:00
parent f9edd52656
commit 5a3c861051
+11 -1
View File
@@ -22,6 +22,15 @@ OpenLayers.Layer.Markers.prototype =
* @type Array(OpenLayers.Marker) */ * @type Array(OpenLayers.Marker) */
markers: null, markers: null,
/** internal state of drawing. This is a workaround for the fact
* that the map does not call moveTo with a zoomChanged when the
* map is first starting up. This lets us catch the case where we
* have *never* drawn the layer, and draw it even if the zoom hasn't
* changed.
* @type Boolean */
drawn: false,
/** /**
* @constructor * @constructor
* *
@@ -51,8 +60,9 @@ OpenLayers.Layer.Markers.prototype =
moveTo:function(bounds, zoomChanged, dragging) { moveTo:function(bounds, zoomChanged, dragging) {
OpenLayers.Layer.prototype.moveTo.apply(this, arguments); OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
if (zoomChanged) { if (zoomChanged || !this.drawn) {
this.redraw(); this.redraw();
this.drawn = true;
} }
}, },