Changeset 1079
- Timestamp:
- 08/03/06 17:28:20 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/euzuro/layerswitcher/lib/OpenLayers.js
r1021 r1079 59 59 "OpenLayers/Icon.js", 60 60 "OpenLayers/Marker.js", 61 "OpenLayers/Marker/Box.js", 61 62 "OpenLayers/Popup.js", 62 63 "OpenLayers/Tile.js", … … 78 79 "OpenLayers/Layer/WMS/Untiled.js", 79 80 "OpenLayers/Layer/GeoRSS.js", 81 "OpenLayers/Layer/Boxes.js", 80 82 "OpenLayers/Popup/Anchored.js", 81 83 "OpenLayers/Popup/AnchoredBubble.js", sandbox/euzuro/layerswitcher/lib/OpenLayers/Layer/Boxes.js
r1077 r1079 9 9 OpenLayers.Layer.Boxes.prototype = 10 10 Object.extend( new OpenLayers.Layer.Markers(), { 11 12 initialize: function () { 13 OpenLayers.Layer.Markers.prototype.initialize.apply(this, arguments); 14 }, 11 15 12 16 /** Calculate the pixel location for the marker, create it, and … … 23 27 var botright = this.map.getLayerPxFromLonLat( 24 28 new OpenLayers.LonLat(bounds.right, bounds.bottom)); 25 if (bot left == null || topright == null) {29 if (botright == null || topleft == null) { 26 30 marker.display(false); 27 31 } else { sandbox/euzuro/layerswitcher/lib/OpenLayers/Marker/Box.js
r1077 r1079 6 6 */ 7 7 OpenLayers.Marker.Box = Class.create(); 8 OpenLayers.Marker. prototype = Object.extend( new OpenLayers.Marker(), {8 OpenLayers.Marker.Box.prototype = Object.extend( new OpenLayers.Marker(), { 9 9 /** @type OpenLayers.LonLat */ 10 10 bounds: null, 11 12 borderColor: null,13 14 borderWidth: null,15 11 16 12 div: null, … … 22 18 * @param {OpenLayers.LonLat lonlat 23 19 */ 24 initialize: function(bounds) { 25 this.bounds = bounds; 26 this.div = OpenLayers.Util.createDiv(); 27 this.events = new OpenLayers.Events(this, this.div, null); 20 initialize: function(bounds, borderColor, borderWidth) { 21 if (arguments.length > 0) { 22 this.bounds = bounds; 23 this.div = OpenLayers.Util.createDiv(); 24 this.events = new OpenLayers.Events(this, this.div, null); 25 this.setBorder(borderColor, borderWidth); 26 } 27 }, 28 29 setBorder: function (color, width) { 30 if (!color) color = "red"; 31 if (!width) width = 2; 32 this.div.style.border = width + "px solid " + color; 28 33 }, 29 34 … … 37 42 draw: function(px, sz) { 38 43 OpenLayers.Util.modifyDOMElement(this.div, null, px, sz); 44 return this.div; 39 45 }, 40 46
