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:
@@ -21,6 +21,15 @@ OpenLayers.Layer.Markers.prototype =
|
||||
/** internal marker list
|
||||
* @type Array(OpenLayers.Marker) */
|
||||
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
|
||||
@@ -51,8 +60,9 @@ OpenLayers.Layer.Markers.prototype =
|
||||
moveTo:function(bounds, zoomChanged, dragging) {
|
||||
OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
|
||||
|
||||
if (zoomChanged) {
|
||||
if (zoomChanged || !this.drawn) {
|
||||
this.redraw();
|
||||
this.drawn = true;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user