Removing unused variables and function. Non-functional change.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11866 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -218,16 +218,8 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
|
||||
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;
|
||||
@@ -289,25 +281,6 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
|
||||
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 [
|
||||
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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user