Changeset 1347
- Timestamp:
- 08/24/06 01:01:10 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/openlayers/2.0/lib/OpenLayers/Control/MouseToolbar.js
r1339 r1347 49 49 centered = centered.add((this.direction == "vertical" ? 0 : sz.w), (this.direction == "vertical" ? sz.h : 0)); 50 50 this.switchModeTo("pan"); 51 this.map.events.register("zoomend", this, function() { this.switchModeTo("pan"); });52 51 return this.div; 53 52 … … 106 105 this.mouseDragStart = evt.xy.clone(); 107 106 this.performedDrag = false; 107 this.startViaKeyboard = false; 108 108 if (evt.shiftKey && this.mode !="zoombox") { 109 109 this.switchModeTo("zoombox"); 110 this.startViaKeyboard = true; 110 111 } else if (evt.altKey && this.mode !="measure") { 111 112 this.switchModeTo("measure"); … … 240 241 switch (this.mode) { 241 242 case "zoombox": 242 console.log(this.mouseDragStart, evt.xy);243 console.log(Math.abs(this.mouseDragStart.x - evt.xy.x) > 5 || Math.abs((this.mouseDragStart.y - evt.xy.y)) > 5);244 console.log(Math.abs(this.mouseDragStart.x-evt.xy.x) > 5);245 console.log(Math.abs(this.mouseDragStart.y-evt.xy.y)>5);246 243 if (Math.abs(this.mouseDragStart.x - evt.xy.x) > 5 || 247 244 Math.abs(this.mouseDragStart.y - evt.xy.y) > 5) { … … 261 258 this.map.viewPortDiv.removeChild(document.getElementById("zoomBox")); 262 259 this.zoomBox = null; 263 this.leaveMode(); 260 console.log(this.startViaKeyboard); 261 if (this.startViaKeyboard) this.leaveMode(); 264 262 break; 265 263 case "pan":
