[OpenLayers-Commits] r11851 -
trunk/openlayers/lib/OpenLayers/Renderer
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Thu Mar 31 18:25:09 EDT 2011
Author: tschaub
Date: 2011-03-31 15:25:06 -0700 (Thu, 31 Mar 2011)
New Revision: 11851
Modified:
trunk/openlayers/lib/OpenLayers/Renderer/Canvas.js
Log:
Making it so the canvas renderer returns true after rendering a feature. This saves an extra draw for every moveTo. p=vog,me r=me (closes #3225)
Modified: trunk/openlayers/lib/OpenLayers/Renderer/Canvas.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Renderer/Canvas.js 2011-03-31 22:02:46 UTC (rev 11850)
+++ trunk/openlayers/lib/OpenLayers/Renderer/Canvas.js 2011-03-31 22:25:06 UTC (rev 11851)
@@ -129,16 +129,25 @@
* Parameters:
* feature - {<OpenLayers.Feature.Vector>}
* style - {<Object>}
+ *
+ * Returns:
+ * {Boolean} The feature has been drawn completely. If the feature has no
+ * geometry, undefined will be returned. If the feature is not rendered
+ * for other reasons, false will be returned.
*/
drawFeature: function(feature, style) {
- style = style || feature.style;
- style = this.applyDefaultSymbolizer(style);
-
- this.features[feature.id] = [feature, style];
- this.redraw();
+ var rendered;
+ if (feature.geometry) {
+ style = style || feature.style;
+ style = this.applyDefaultSymbolizer(style);
+
+ this.features[feature.id] = [feature, style];
+ this.redraw();
+ rendered = true;
+ }
+ return rendered;
},
-
/**
* Method: drawGeometry
* Used when looping (in redraw) over the features; draws
More information about the Commits
mailing list