diff --git a/lib/OpenLayers/Icon.js b/lib/OpenLayers/Icon.js index b6e661a84e..66cbc990af 100644 --- a/lib/OpenLayers/Icon.js +++ b/lib/OpenLayers/Icon.js @@ -1,16 +1,27 @@ +/** +* @class +*/ OpenLayers.Icon = Class.create(); OpenLayers.Icon.prototype = { - // string: image url + /** image url + * @type String */ url: null, - // {OpenLayers.Size}: size of image + /** @type OpenLayers.Size */ size:null, /** distance in pixels to offset the image when being rendered * @type OpenLayers.Pixel */ offset: null, + /** + * @constructor + * + * @param {String} url + * @param {OpenLayers.Size} size + * @param {OpenLayers.Pixel} offset + */ initialize: function(url, size, offset) { this.size = size; this.url = url; @@ -23,8 +34,14 @@ OpenLayers.Icon.prototype = { }, - // Create a copy of this icon. + /** + * @returns A fresh copy of the icon. + * @type OpenLayers.Icon + */ clone: function() { - return new OpenLayers.Icon(this.size, this.url); - } + return new OpenLayers.Icon(this.size, this.url, this.offset); + }, + + /** @final @type String */ + CLASS_NAME: "OpenLayers.Icon" }