[OpenLayers-Commits] r12363 - in sandbox/aabt/openlayers/lib/OpenLayers: Feature Renderer

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Wed Sep 14 10:01:33 EDT 2011


Author: aabt
Date: 2011-09-14 07:01:32 -0700 (Wed, 14 Sep 2011)
New Revision: 12363

Modified:
   sandbox/aabt/openlayers/lib/OpenLayers/Feature/Vector.js
   sandbox/aabt/openlayers/lib/OpenLayers/Renderer/Canvas.js
Log:
nillable label outline

Modified: sandbox/aabt/openlayers/lib/OpenLayers/Feature/Vector.js
===================================================================
--- sandbox/aabt/openlayers/lib/OpenLayers/Feature/Vector.js	2011-09-14 13:34:23 UTC (rev 12362)
+++ sandbox/aabt/openlayers/lib/OpenLayers/Feature/Vector.js	2011-09-14 14:01:32 UTC (rev 12363)
@@ -420,7 +420,7 @@
  * labelSelect - {Boolean} If set to true, labels will be selectable using SelectFeature or similar controls.
  *     Default is false.
  * labelOutlineColor - {String} The color of the label outline. Default is 'white'. Only supported by the canvas renderer.
- * labelOutlineWidth - {Number} The width of the label outline. Default is 3. Only supported by the canvas renderer.
+ * labelOutlineWidth - {Number} The width of the label outline. Default is 3, set to 0 or null to disable. Only supported by the canvas renderer.
  * fontColor - {String} The font color for the label, to be provided like CSS.
  * fontOpacity - {Number} Opacity (0-1) for the label
  * fontFamily - {String} The font family for the label, to be provided like in CSS.

Modified: sandbox/aabt/openlayers/lib/OpenLayers/Renderer/Canvas.js
===================================================================
--- sandbox/aabt/openlayers/lib/OpenLayers/Renderer/Canvas.js	2011-09-14 13:34:23 UTC (rev 12362)
+++ sandbox/aabt/openlayers/lib/OpenLayers/Renderer/Canvas.js	2011-09-14 14:01:32 UTC (rev 12363)
@@ -535,11 +535,13 @@
                 this.canvas.measureText('xx').width;
             pt[1] += lineHeight*vfactor*(numRows-1);
             for (var i = 0; i < numRows; i++) {
-                this.canvas.save();
-                this.canvas.strokeStyle = style.labelOutlineColor;
-                this.canvas.lineWidth = style.labelOutlineWidth;
-                this.canvas.strokeText(labelRows[i], pt[0], pt[1] + (lineHeight*i));
-                this.canvas.restore();
+                if (style.labelOutlineWidth) {
+                    this.canvas.save();
+                    this.canvas.strokeStyle = style.labelOutlineColor;
+                    this.canvas.lineWidth = style.labelOutlineWidth;
+                    this.canvas.strokeText(labelRows[i], pt[0], pt[1] + (lineHeight*i));
+                    this.canvas.restore();
+                }
                 this.canvas.fillText(labelRows[i], pt[0], pt[1] + (lineHeight*i));
             }
         } else if (this.canvas.mozDrawText) {



More information about the Commits mailing list