[OpenLayers-Commits] r11766 -
sandbox/tschaub/canvas/lib/OpenLayers/Renderer
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Wed Mar 30 01:43:20 EDT 2011
Author: tschaub
Date: 2011-03-29 22:43:19 -0700 (Tue, 29 Mar 2011)
New Revision: 11766
Modified:
sandbox/tschaub/canvas/lib/OpenLayers/Renderer/Canvas.js
Log:
A bit more doc.
Modified: sandbox/tschaub/canvas/lib/OpenLayers/Renderer/Canvas.js
===================================================================
--- sandbox/tschaub/canvas/lib/OpenLayers/Renderer/Canvas.js 2011-03-30 05:03:20 UTC (rev 11765)
+++ sandbox/tschaub/canvas/lib/OpenLayers/Renderer/Canvas.js 2011-03-30 05:43:19 UTC (rev 11766)
@@ -274,6 +274,16 @@
}
},
+ /**
+ * Method: featureIdToHex
+ * Convert a feature ID string into an RGB hex string.
+ *
+ * Parameters:
+ * featureId - {String} Feature id
+ *
+ * Returns:
+ * {String} RGB hex string.
+ */
featureIdToHex: function(featureId) {
var id = Number(featureId.split("_").pop()) + 1; // zero for no feature
if (id >= 16777216) {
@@ -286,6 +296,16 @@
return hex;
},
+ /**
+ * Method: featureIdToRGB
+ * Convert a feature ID string into an RGB array.
+ *
+ * Parameters:
+ * featureId - {String} Feature id
+ *
+ * Returns:
+ * {Array} RGB values.
+ */
featureIdToRGB: function(featureId) {
var hex = this.featureIdToHex(featureId);
return [
More information about the Commits
mailing list