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:
@@ -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;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user