Changeset 556
- Timestamp:
- 06/07/06 23:46:33 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Control/MouseToolbar.js
r555 r556 1 1 // @require: OpenLayers/Control.js 2 2 OpenLayers.Control.MouseToolbar = Class.create(); 3 OpenLayers.Control.MouseToolbar.X = 4;4 OpenLayers.Control.MouseToolbar.Y = 4;3 OpenLayers.Control.MouseToolbar.X = 6; 4 OpenLayers.Control.MouseToolbar.Y = 300; 5 5 OpenLayers.Control.MouseToolbar.prototype = 6 6 Object.extend( new OpenLayers.Control(), { … … 12 12 direction: "vertical", 13 13 14 initialize: function( direction) {14 initialize: function(position, direction) { 15 15 OpenLayers.Control.prototype.initialize.apply(this, arguments); 16 this.position = new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X, 17 OpenLayers.Control.MouseToolbar.Y); 18 if (position) { 19 this.position = position; 20 } 16 21 if (direction) { 17 22 this.direction = direction; … … 29 34 this.map.events.register( "mouseout", this, this.defaultMouseOut ); 30 35 var sz = new OpenLayers.Size(28,28); 31 var centered = new OpenLayers.Pixel(12, 300);36 var centered = this.position; 32 37 this._addButton("zoombox", "drag-rectangle-off.png", "drag-rectangle-on.png", centered, sz); 33 this._addButton("pan", "panning-hand-off.png", "panning-hand-on.png", new OpenLayers.Pixel(12,328), sz); 34 this._addButton("measure", "measuring-stick-off.png", "measuring-stick-on.png", new OpenLayers.Pixel(12,356), sz); 38 centered = centered.add((this.direction == "vertical" ? 0 : sz.w), (this.direction == "vertical" ? sz.h : 0)); 39 this._addButton("pan", "panning-hand-off.png", "panning-hand-on.png", centered, sz); 40 centered = centered.add((this.direction == "vertical" ? 0 : sz.w), (this.direction == "vertical" ? sz.h : 0)); 41 this._addButton("measure", "measuring-stick-off.png", "measuring-stick-on.png", centered, sz); 35 42 this.switchModeTo("pan"); 36 43 this.map.events.register("zoomend", this, function() { this.switchModeTo("pan"); });
