Making it so the clear method on the canvas renderer permanently clears features (as with the other renderers). r=crschmidt (closes #2775)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10595 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2010-08-05 15:34:48 +00:00
parent d965d4a1a0
commit c15a1a0779

View File

@@ -393,14 +393,14 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
var y = ((extent.top / resolution) - point.y / resolution);
return [x, y];
},
/**
* Method: clear
* Clear all vectors from the renderer.
* virtual function.
*/
clear: function() {
this.canvas.clearRect(0, 0, this.root.width, this.root.height);
this.features = {};
},
/**
@@ -458,7 +458,7 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
*/
redraw: function() {
if (!this.locked) {
this.clear();
this.canvas.clearRect(0, 0, this.root.width, this.root.height);
var labelMap = [];
var feature, style;
for (var id in this.features) {