diff --git a/lib/OpenLayers/Marker/Box.js b/lib/OpenLayers/Marker/Box.js index 05e3223e15..300c192346 100644 --- a/lib/OpenLayers/Marker/Box.js +++ b/lib/OpenLayers/Marker/Box.js @@ -10,17 +10,20 @@ */ OpenLayers.Marker.Box = OpenLayers.Class.create(); OpenLayers.Marker.Box.prototype = OpenLayers.Class.inherit( OpenLayers.Marker, { - /** @type OpenLayers.LonLat */ + + /** @type OpenLayers.Bounds */ bounds: null, + /** @type DOMElement */ div: null, /** - * @constructor - * - * @param {OpenLayers.Icon} icon - * @param {OpenLayers.LonLat lonlat - */ + * @constructor + * + * @param {OpenLayers.Bounds} bounds + * @param {String} borderColor + * @param {int} borderWidth + */ initialize: function(bounds, borderColor, borderWidth) { this.bounds = bounds; this.div = OpenLayers.Util.createDiv(); @@ -29,14 +32,20 @@ OpenLayers.Marker.Box.prototype = OpenLayers.Class.inherit( OpenLayers.Marker, { this.setBorder(borderColor, borderWidth); }, + /** Allow the user to change the box's color and border width + * + * @param {String} color Default is "red" + * @param {int} width Default is 2 + */ setBorder: function (color, width) { - if (!color) color = "red"; - if (!width) width = 2; + color = color || "red"; + width = width || 2; this.div.style.border = width + "px solid " + color; }, /** * @param {OpenLayers.Pixel} px + * @param {OpenLayers.Size} sz * * @return A new DOM Image with this markerīs icon set at the * location passed-in