Modify classes which contained an internal numeric zero padding function to use the one in BaseTypes instead

This commit is contained in:
Matt Priour
2012-08-08 22:36:39 -05:00
parent dc93478e6b
commit a83ab56f97
3 changed files with 17 additions and 57 deletions

View File

@@ -443,9 +443,9 @@ OpenLayers.Layer.ArcGISCache = OpenLayers.Class(OpenLayers.Layer.XYZ, {
url = url + '/tile/${z}/${y}/${x}';
} else {
// The tile images are stored using hex values on disk.
x = 'C' + this.zeroPad(x, 8, 16);
y = 'R' + this.zeroPad(y, 8, 16);
z = 'L' + this.zeroPad(z, 2, 16);
x = 'C' + OpenLayers.Number.zeroPad(x, 8, 16);
y = 'R' + OpenLayers.Number.zeroPad(y, 8, 16);
z = 'L' + OpenLayers.Number.zeroPad(z, 2, 16);
url = url + '/${z}/${y}/${x}.' + this.type;
}
@@ -457,23 +457,5 @@ OpenLayers.Layer.ArcGISCache = OpenLayers.Class(OpenLayers.Layer.XYZ, {
);
},
/**
* Method: zeroPad
* Create a zero padded string optionally with a radix for casting numbers.
*
* Parameters:
* num - {Number} The number to be zero padded.
* len - {Number} The length of the string to be returned.
* radix - {Number} An integer between 2 and 36 specifying the base to use
* for representing numeric values.
*/
zeroPad: function(num, len, radix) {
var str = num.toString(radix || 10);
while (str.length < len) {
str = "0" + str;
}
return str;
},
CLASS_NAME: 'OpenLayers.Layer.ArcGISCache'
});