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