[OpenLayers-Commits] r11866 - in trunk/openlayers: lib/OpenLayers/Renderer tests/Renderer

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Mon Apr 4 03:58:14 EDT 2011


Author: ahocevar
Date: 2011-04-04 00:58:13 -0700 (Mon, 04 Apr 2011)
New Revision: 11866

Modified:
   trunk/openlayers/lib/OpenLayers/Renderer/Canvas.js
   trunk/openlayers/tests/Renderer/Canvas.html
Log:
Removing unused variables and function. Non-functional change.

Modified: trunk/openlayers/lib/OpenLayers/Renderer/Canvas.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Renderer/Canvas.js	2011-04-04 07:47:07 UTC (rev 11865)
+++ trunk/openlayers/lib/OpenLayers/Renderer/Canvas.js	2011-04-04 07:58:13 UTC (rev 11866)
@@ -218,16 +218,8 @@
         var x = pt[0] + xOffset;
         var y = pt[1] + yOffset;
 
-        var numRows = this.root.width;
-        var numCols = this.root.height;
-
         var opacity = style.graphicOpacity || style.fillOpacity;
         
-        var rgb = this.featureIdToRGB(featureId);
-        var red = rgb[0];
-        var green = rgb[1];
-        var blue = rgb[2];
-        
         var onLoad = function() {
             // TODO: check that we haven't moved
             var canvas = this.canvas;
@@ -290,25 +282,6 @@
     },
     
     /**
-     * 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 [
-            parseInt(hex.substring(1, 3), 16),
-            parseInt(hex.substring(3, 5), 16),
-            parseInt(hex.substring(5, 7), 16)
-        ];
-    },
-
-    /**
      * Method: setHitContextStyle
      * Prepare the hit canvas for drawing by setting various global settings.
      *

Modified: trunk/openlayers/tests/Renderer/Canvas.html
===================================================================
--- trunk/openlayers/tests/Renderer/Canvas.html	2011-04-04 07:47:07 UTC (rev 11865)
+++ trunk/openlayers/tests/Renderer/Canvas.html	2011-04-04 07:58:13 UTC (rev 11866)
@@ -60,40 +60,6 @@
         map.destroy();
     }
 
-    function test_featureIdToRGB(t) {
-        if (!supported) {
-            t.plan(0); 
-            return;
-        }
-        t.plan(2);
-        var el = document.body;
-        el.id = "foo";
-        var renderer = new OpenLayers.Renderer.Canvas(el.id);
-        
-        var cases = [{
-            id: "foo_0", rgb: [0, 0, 1]
-        }, {
-            id: "foo_10", rgb: [0, 0, 11]
-        }, {
-            id: "foo_100", rgb: [0, 0, 101]
-        }, {
-            id: "foo_1000000", rgb: [15, 66, 65]
-        }, {
-            id: "foo_16777214", rgb: [255, 255, 255]
-        }, {
-            id: "foo_16777215", rgb: [0, 0, 1]
-        }];
-        t.plan(cases.length);
-        
-        var c;
-        for (var i=0; i<cases.length; ++i) {
-            c = cases[i];
-            t.eq(renderer.featureIdToRGB(c.id), c.rgb, c.id);
-        }
-        
-        renderer.destroy();
-    }
-
     function test_featureIdToHex(t) {
         if (!supported) {
             t.plan(0); 



More information about the Commits mailing list