Changeset 1588
- Timestamp:
- 10/05/06 10:50:47 (2 years ago)
- Files:
-
- trunk/openlayers/build/license.txt (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Ajax.js (modified) (3 diffs)
- trunk/openlayers/lib/OpenLayers/BaseTypes.js (modified) (11 diffs)
- trunk/openlayers/lib/OpenLayers/Control.js (modified) (2 diffs)
- trunk/openlayers/lib/OpenLayers/Control/KeyboardDefaults.js (modified) (3 diffs)
- trunk/openlayers/lib/OpenLayers/Control/LayerSwitcher.js (modified) (11 diffs)
- trunk/openlayers/lib/OpenLayers/Control/MouseDefaults.js (modified) (9 diffs)
- trunk/openlayers/lib/OpenLayers/Control/MouseToolbar.js (modified) (8 diffs)
- trunk/openlayers/lib/OpenLayers/Control/PanZoom.js (modified) (4 diffs)
- trunk/openlayers/lib/OpenLayers/Control/PanZoomBar.js (modified) (8 diffs)
- trunk/openlayers/lib/OpenLayers/Control/Permalink.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Control/Scale.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Events.js (modified) (5 diffs)
- trunk/openlayers/lib/OpenLayers/Feature.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Feature/WFS.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Icon.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer.js (modified) (3 diffs)
- trunk/openlayers/lib/OpenLayers/Layer/Boxes.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/Canvas.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/EventPane.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/FixedZoomLevels.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/GeoRSS.js (modified) (3 diffs)
- trunk/openlayers/lib/OpenLayers/Layer/Google.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/Grid.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/HTTPRequest.js (modified) (4 diffs)
- trunk/openlayers/lib/OpenLayers/Layer/KaMap.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/MapServer.js (modified) (2 diffs)
- trunk/openlayers/lib/OpenLayers/Layer/Markers.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/MultiMap.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/Text.js (modified) (2 diffs)
- trunk/openlayers/lib/OpenLayers/Layer/VirtualEarth.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/WFS.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/WMS.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/WMS/Untiled.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/WorldWind.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Layer/Yahoo.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Map.js (modified) (5 diffs)
- trunk/openlayers/lib/OpenLayers/Marker.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Marker/Box.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Popup.js (modified) (5 diffs)
- trunk/openlayers/lib/OpenLayers/Popup/Anchored.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Popup/AnchoredBubble.js (modified) (2 diffs)
- trunk/openlayers/lib/OpenLayers/Tile.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Tile/Image.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Tile/WFS.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Util.js (modified) (8 diffs)
- trunk/openlayers/lib/Prototype.js (deleted)
- trunk/openlayers/lib/Rico/Color.js (modified) (1 diff)
- trunk/openlayers/lib/Rico/Corner.js (modified) (1 diff)
- trunk/openlayers/tests/test_Layer_WMS.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/build/license.txt
r1424 r1588 14 14 */ 15 15 16 /* Prototype JavaScript framework, version 1.4.0 16 /* Contains portions of Prototype.js: 17 * 18 * Prototype JavaScript framework, version 1.4.0 17 19 * (c) 2005 Sam Stephenson <sam@conio.net> 18 20 * trunk/openlayers/lib/OpenLayers.js
r1555 r1588 49 49 (function() { 50 50 var jsfiles=new Array( 51 "Prototype.js", 51 "OpenLayers/BaseTypes.js", 52 "OpenLayers/Util.js", 53 "OpenLayers/Prototype.js", 52 54 "Rico/Corner.js", 53 55 "Rico/Color.js", 54 "OpenLayers/BaseTypes.js",55 "OpenLayers/Util.js",56 56 "OpenLayers/Ajax.js", 57 57 "OpenLayers/Events.js", trunk/openlayers/lib/OpenLayers/Ajax.js
r1424 r1588 61 61 62 62 // from prototype.js 63 new Ajax.Request(uri,63 new OpenLayers.Ajax.Request(uri, 64 64 { method: 'get', 65 65 parameters: params, … … 84 84 } 85 85 86 var ajaxResponse = Try.these(86 var ajaxResponse = OpenLayers.Util.Try( 87 87 function() { 88 88 var xmldom = new ActiveXObject('Microsoft.XMLDOM'); … … 107 107 return ajaxResponse; 108 108 }; 109 110 OpenLayers.Ajax = { 111 emptyFunction: function () {}, 112 113 getTransport: function() { 114 return OpenLayers.Util.Try( 115 function() {return new ActiveXObject('Msxml2.XMLHTTP')}, 116 function() {return new ActiveXObject('Microsoft.XMLHTTP')}, 117 function() {return new XMLHttpRequest()} 118 ) || false; 119 }, 120 121 activeRequestCount: 0 122 }; 123 124 OpenLayers.Ajax.Responders = { 125 responders: [], 126 127 register: function(responderToAdd) { 128 for (var i = 0; i < this.responders.length; i++) 129 if (responderToAdd == this.responders[i]) 130 return; 131 this.responders.push(responderToAdd); 132 }, 133 134 dispatch: function(callback, request, transport, json) { 135 for (var i = 0; i < this.responders.length; i++) { 136 responder = this.responders[i]; 137 if (responder[callback] && typeof responder[callback] == 'function') { 138 try { 139 responder[callback].apply(responder, [request, transport, json]); 140 } catch (e) {} 141 } 142 } 143 } 144 }; 145 146 OpenLayers.Ajax.Responders.register({ 147 onCreate: function() { 148 OpenLayers.Ajax.activeRequestCount++; 149 }, 150 151 onComplete: function() { 152 OpenLayers.Ajax.activeRequestCount--; 153 } 154 }); 155 156 OpenLayers.Ajax.Base = function() {}; 157 OpenLayers.Ajax.Base.prototype = { 158 setOptions: function(options) { 159 this.options = { 160 method: 'post', 161 asynchronous: true, 162 parameters: '' 163 } 164 OpenLayers.Util.extend(this.options, options || {}); 165 }, 166 167 responseIsSuccess: function() { 168 return this.transport.status == undefined 169 || this.transport.status == 0 170 || (this.transport.status >= 200 && this.transport.status < 300); 171 }, 172 173 responseIsFailure: function() { 174 return !this.responseIsSuccess(); 175 } 176 } 177 178 OpenLayers.Ajax.Request = OpenLayers.Class.create(); 179 OpenLayers.Ajax.Request.Events = 180 ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; 181 182 OpenLayers.Ajax.Request.prototype = OpenLayers.Util.extend(new OpenLayers.Ajax.Base(), { 183 initialize: function(url, options) { 184 this.transport = OpenLayers.Ajax.getTransport(); 185 this.setOptions(options); 186 this.request(url); 187 }, 188 189 request: function(url) { 190 var parameters = this.options.parameters || ''; 191 if (parameters.length > 0) parameters += '&_='; 192 193 try { 194 this.url = url; 195 if (this.options.method == 'get' && parameters.length > 0) 196 this.url += (this.url.match(/\?/) ? '&' : '?') + parameters; 197 198 OpenLayers.Ajax.Responders.dispatch('onCreate', this, this.transport); 199 200 this.transport.open(this.options.method, this.url, 201 this.options.asynchronous); 202 203 if (this.options.asynchronous) { 204 this.transport.onreadystatechange = this.onStateChange.bind(this); 205 setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10); 206 } 207 208 this.setRequestHeaders(); 209 210 var body = this.options.postBody ? this.options.postBody : parameters; 211 this.transport.send(this.options.method == 'post' ? body : null); 212 213 } catch (e) { 214 this.dispatchException(e); 215 } 216 }, 217 218 setRequestHeaders: function() { 219 var requestHeaders = 220 ['X-Requested-With', 'XMLHttpRequest', 221 'X-Prototype-Version', 'OpenLayers']; 222 223 if (this.options.method == 'post') { 224 requestHeaders.push('Content-type', 225 'application/x-www-form-urlencoded'); 226 227 /* Force "Connection: close" for Mozilla browsers to work around 228 * a bug where XMLHttpReqeuest sends an incorrect Content-length 229 * header. See Mozilla Bugzilla #246651. 230 */ 231 if (this.transport.overrideMimeType) 232 requestHeaders.push('Connection', 'close'); 233 } 234 235 if (this.options.requestHeaders) 236 requestHeaders.push.apply(requestHeaders, this.options.requestHeaders); 237 238 for (var i = 0; i < requestHeaders.length; i += 2) 239 this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]); 240 }, 241 242 onStateChange: function() { 243 var readyState = this.transport.readyState; 244 if (readyState != 1) 245 this.respondToReadyState(this.transport.readyState); 246 }, 247 248 header: function(name) { 249 try { 250 return this.transport.getResponseHeader(name); 251 } catch (e) {} 252 }, 253 254 evalJSON: function() { 255 try { 256 return eval(this.header('X-JSON')); 257 } catch (e) {} 258 }, 259 260 evalResponse: function() { 261 try { 262 return eval(this.transport.responseText); 263 } catch (e) { 264 this.dispatchException(e); 265 } 266 }, 267 268 respondToReadyState: function(readyState) { 269 var event = OpenLayers.Ajax.Request.Events[readyState]; 270 var transport = this.transport, json = this.evalJSON(); 271 272 if (event == 'Complete') { 273 try { 274 (this.options['on' + this.transport.status] 275 || this.options['on' + (this.responseIsSuccess() ? 'Success' : 'Failure')] 276 || OpenLayers.Ajax.emptyFunction)(transport, json); 277 } catch (e) { 278 this.dispatchException(e); 279 } 280 281 if ((this.header('Content-type') || '').match(/^text\/javascript/i)) 282 this.evalResponse(); 283 } 284 285 try { 286 (this.options['on' + event] || OpenLayers.Ajax.emptyFunction)(transport, json); 287 OpenLayers.Ajax.Responders.dispatch('on' + event, this, transport, json); 288 } catch (e) { 289 this.dispatchException(e); 290 } 291 292 /* Avoid memory leak in MSIE: clean up the oncomplete event handler */ 293 if (event == 'Complete') 294 this.transport.onreadystatechange = OpenLayers.Ajax.emptyFunction; 295 }, 296 297 dispatchException: function(exception) { 298 (this.options.onException || OpenLayers.Ajax.emptyFunction)(this, exception); 299 OpenLayers.Ajax.Responders.dispatch('onException', this, exception); 300 } 301 }); 302 trunk/openlayers/lib/OpenLayers/BaseTypes.js
r1572 r1588 3 3 * text of the license. */ 4 4 5 /* OpenLayers.Class metaclass */ 6 OpenLayers.Class = { 7 create: function() { 8 return function() { 9 this.initialize.apply(this, arguments); 10 } 11 } 12 }; 5 13 6 14 /********************* … … 10 18 *********************/ 11 19 12 13 20 /** 14 21 * @class … … 16 23 * This class represents a screen coordinate, in x and y coordinates 17 24 */ 18 OpenLayers.Pixel = Class.create();25 OpenLayers.Pixel = OpenLayers.Class.create(); 19 26 OpenLayers.Pixel.prototype = { 20 27 … … 107 114 * This class represents a width and height pair 108 115 */ 109 OpenLayers.Size = Class.create();116 OpenLayers.Size = OpenLayers.Class.create(); 110 117 OpenLayers.Size.prototype = { 111 118 … … 178 185 * This class represents a longitude and latitude pair 179 186 */ 180 OpenLayers.LonLat = Class.create();187 OpenLayers.LonLat = OpenLayers.Class.create(); 181 188 OpenLayers.LonLat.prototype = { 182 189 … … 291 298 * Data stored as left, bottom, right, top floats 292 299 */ 293 OpenLayers.Bounds = Class.create();300 OpenLayers.Bounds = OpenLayers.Class.create(); 294 301 OpenLayers.Bounds.prototype = { 295 302 … … 653 660 654 661 655 662 /********************* 663 * * 664 * ELEMENT * 665 * * 666 *********************/ 667 668 OpenLayers.Element = { 669 visible: function(element) { 670 return $(element).style.display != 'none'; 671 }, 672 673 toggle: function() { 674 for (var i = 0; i < arguments.length; i++) { 675 var element = $(arguments[i]); 676 OpenLayers.Element[OpenLayers.Element.visible(element) ? 'hide' : 'show'](element); 677 } 678 }, 679 680 hide: function() { 681 for (var i = 0; i < arguments.length; i++) { 682 var element = $(arguments[i]); 683 element.style.display = 'none'; 684 } 685 }, 686 687 show: function() { 688 for (var i = 0; i < arguments.length; i++) { 689 var element = $(arguments[i]); 690 element.style.display = ''; 691 } 692 }, 693 694 remove: function(element) { 695 element = $(element); 696 element.parentNode.removeChild(element); 697 }, 698 699 getHeight: function(element) { 700 element = $(element); 701 return element.offsetHeight; 702 }, 703 704 getDimensions: function(element) { 705 element = $(element); 706 if (OpenLayers.Element.getStyle(element, 'display') != 'none') 707 return {width: element.offsetWidth, height: element.offsetHeight}; 708 709 // All *Width and *Height properties give 0 on elements with display none, 710 // so enable the element temporarily 711 var els = element.style; 712 var originalVisibility = els.visibility; 713 var originalPosition = els.position; 714 els.visibility = 'hidden'; 715 els.position = 'absolute'; 716 els.display = ''; 717 var originalWidth = element.clientWidth; 718 var originalHeight = element.clientHeight; 719 els.display = 'none'; 720 els.position = originalPosition; 721 els.visibility = originalVisibility; 722 return {width: originalWidth, height: originalHeight}; 723 }, 724 725 getStyle: function(element, style) { 726 element = $(element); 727 var value = element.style[style.camelize()]; 728 if (!value) { 729 if (document.defaultView && document.defaultView.getComputedStyle) { 730 var css = document.defaultView.getComputedStyle(element, null); 731 value = css ? css.getPropertyValue(style) : null; 732 } else if (element.currentStyle) { 733 value = element.currentStyle[style.camelize()]; 734 } 735 } 736 737 if (window.opera && ['left', 'top', 'right', 'bottom'].include(style)) 738 if (OpenLayers.Element.getStyle(element, 'position') == 'static') value = 'auto'; 739 740 return value == 'auto' ? null : value; 741 } 742 743 }; 656 744 657 745 /********************* … … 661 749 *********************/ 662 750 663 664 665 751 /** 666 752 * @param {String} sStart … … 703 789 }; 704 790 791 792 String.indexOf = function(object) { 793 for (var i = 0; i < this.length; i++) 794 if (this[i] == object) return i; 795 return -1; 796 }; 797 798 String.prototype.camelize = function() { 799 var oStringList = this.split('-'); 800 if (oStringList.length == 1) return oStringList[0]; 801 802 var camelizedString = this.indexOf('-') == 0 803 ? oStringList[0].charAt(0).toUpperCase() + oStringList[0].substring(1) 804 : oStringList[0]; 805 806 for (var i = 1, len = oStringList.length; i < len; i++) { 807 var s = oStringList[i]; 808 camelizedString += s.charAt(0).toUpperCase() + s.substring(1); 809 } 810 811 return camelizedString; 812 }; 705 813 706 814 … … 756 864 * * 757 865 *********************/ 758 759 760 866 761 867 /** NOTE: Works only with integer values does *not* work with floats! … … 775 881 return parseInt(number); 776 882 } 883 884 885 /********************* 886 * * 887 * FUNCTION * 888 * * 889 *********************/ 890 891 Function.prototype.bind = function() { 892 var __method = this, args = [], object = arguments[0]; 893 for (var i = 1; i < arguments.length; i++) 894 args.push(arguments[i]); 895 return function(moreargs) { 896 for (var i = 0; i < arguments.length; i++) 897 args.push(arguments[i]); 898 return __method.apply(object, args); 899 } 900 }; 901 902 Function.prototype.bindAsEventListener = function(object) { 903 var __method = this; 904 return function(event) { 905 return __method.call(object, event || window.event); 906 } 907 }; trunk/openlayers/lib/OpenLayers/Control.js
r1424 r1588 6 6 * @class 7 7 */ 8 OpenLayers.Control = Class.create();8 OpenLayers.Control = OpenLayers.Class.create(); 9 9 OpenLayers.Control.prototype = { 10 10 … … 31 31 */ 32 32 initialize: function (options) { 33 O bject.extend(this, options);33 OpenLayers.Util.extend(this, options); 34 34 35 35 this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_"); trunk/openlayers/lib/OpenLayers/Control/KeyboardDefaults.js
r1424 r1588 8 8 * @requires OpenLayers/Control.js 9 9 */ 10 OpenLayers.Control.KeyboardDefaults = Class.create();10 OpenLayers.Control.KeyboardDefaults = OpenLayers.Class.create(); 11 11 OpenLayers.Control.KeyboardDefaults.prototype = 12 O bject.extend( new OpenLayers.Control(), {12 OpenLayers.Util.extend( new OpenLayers.Control(), { 13 13 14 14 /** @type int */ … … 26 26 */ 27 27 draw: function() { 28 Event.observe(document,28 OpenLayers.Event.observe(document, 29 29 'keypress', 30 30 this.defaultKeyDown.bind(this)); … … 36 36 defaultKeyDown: function (evt) { 37 37 switch(evt.keyCode) { 38 case Event.KEY_LEFT:38 case OpenLayers.Event.KEY_LEFT: 39 39 this.map.pan(-50, 0); 40 40 break; 41 case Event.KEY_RIGHT:41 case OpenLayers.Event.KEY_RIGHT: 42 42 this.map.pan(50, 0); 43 43 break; 44 case Event.KEY_UP:44 case OpenLayers.Event.KEY_UP: 45 45 this.map.pan(0, -50); 46 46 break; 47 case Event.KEY_DOWN:47 case OpenLayers.Event.KEY_DOWN: 48 48 this.map.pan(0, 50); 49 49 break; trunk/openlayers/lib/OpenLayers/Control/LayerSwitcher.js
r1580 r1588 8 8 * @requires OpenLayers/Control.js 9 9 */ 10 OpenLayers.Control.LayerSwitcher = Class.create();10 OpenLayers.Control.LayerSwitcher = OpenLayers.Class.create(); 11 11 OpenLayers.Control.LayerSwitcher.prototype = 12 O bject.extend( new OpenLayers.Control(), {12 OpenLayers.Util.extend( new OpenLayers.Control(), { 13 13 14 14 /** @type String */ … … 130 130 inputElem.layer = layer; 131 131 inputElem.control = this; 132 132 133 if (!baseLayer && !layer.inRange()) { 133 134 inputElem.disabled = true; 134 135 } 135 Event.observe(inputElem, "mouseup",136 OpenLayers.Event.observe(inputElem, "mouseup", 136 137 this.onInputClick.bindAsEventListener(inputElem)); 137 138 … … 143 144 labelSpan.innerHTML = layer.name; 144 145 labelSpan.style.verticalAlign = (baseLayer) ? "bottom" : "baseline"; 145 Event.observe(labelSpan, "click",146 OpenLayers.Event.observe(labelSpan, "click", 146 147 this.onInputClick.bindAsEventListener(inputElem)); 147 148 // create line break … … 186 187 } 187 188 } 188 Event.stop(e);189 OpenLayers.Event.stop(e); 189 190 }, 190 191 … … 238 239 239 240 if (e != null) { 240 Event.stop(e);241 OpenLayers.Event.stop(e); 241 242 } 242 243 }, … … 255 256 256 257 if (e != null) { 257 Event.stop(e);258 OpenLayers.Event.stop(e); 258 259 } 259 260 }, … … 293 294 this.div.style.backgroundColor = "transparent"; 294 295 295 Event.observe(this.div, "mouseup",296 OpenLayers.Event.observe(this.div, "mouseup", 296 297 this.mouseUp.bindAsEventListener(this)); 297 Event.observe(this.div, "click",298 OpenLayers.Event.observe(this.div, "click", 298 299 this.ignoreEvent); 299 Event.observe(this.div, "mousedown",300 OpenLayers.Event.observe(this.div, "mousedown", 300 301 this.mouseDown.bindAsEventListener(this)); 301 Event.observe(this.div, "dblclick", this.ignoreEvent);302 OpenLayers.Event.observe(this.div, "dblclick", this.ignoreEvent); 302 303 303 304 … … 326 327 this.baseLayersDiv = document.createElement("div"); 327 328 this.baseLayersDiv.style.paddingLeft = "10px"; 328 /* Event.observe(this.baseLayersDiv, "click",329 /*OpenLayers.Event.observe(this.baseLayersDiv, "click", 329 330 this.onLayerClick.bindAsEventListener(this)); 330 331 */ … … 376 377 this.maximizeDiv.style.left = ""; 377 378 this.maximizeDiv.style.display = "none"; 378 Event.observe(this.maximizeDiv,379 OpenLayers.Event.observe(this.maximizeDiv, 379 380 "click", 380 381 this.maximizeControl.bindAsEventListener(this)); … … 395 396 this.minimizeDiv.style.left = ""; 396 397 this.minimizeDiv.style.display = "none"; 397 Event.observe(this.minimizeDiv,398 OpenLayers.Event.observe(this.minimizeDiv, 398 399 "click", 399 400 this.minimizeControl.bindAsEventListener(this)); … … 408 409 */ 409 410 ignoreEvent: function(evt) { 410 Event.stop(evt);411 OpenLayers.Event.stop(evt); 411 412 }, 412 413 trunk/openlayers/lib/OpenLayers/Control/MouseDefaults.js
r1476 r1588 8 8 * @requires OpenLayers/Control.js 9 9 */ 10 OpenLayers.Control.MouseDefaults = Class.create();10 OpenLayers.Control.MouseDefaults = OpenLayers.Class.create(); 11 11 OpenLayers.Control.MouseDefaults.prototype = 12 O bject.extend( new OpenLayers.Control(), {12 OpenLayers.Util.extend( new OpenLayers.Control(), { 13 13 14 14 /** @type Boolean */ … … 22 22 23 23 //register mousewheel events specifically on the window and document 24 Event.observe(window, "DOMMouseScroll",24 OpenLayers.Event.observe(window, "DOMMouseScroll", 25 25 this.onWheelEvent.bindAsEventListener(this)); 26 Event.observe(window, "mousewheel",26 OpenLayers.Event.observe(window, "mousewheel", 27 27 this.onWheelEvent.bindAsEventListener(this)); 28 Event.observe(document, "mousewheel",28 OpenLayers.Event.observe(document, "mousewheel", 29 29 this.onWheelEvent.bindAsEventListener(this)); 30 30 }, … … 48 48 */ 49 49 defaultClick: function (evt) { 50 if (! Event.isLeftClick(evt)) return;50 if (!OpenLayers.Event.isLeftClick(evt)) return; 51 51 var notAfterDrag = !this.performedDrag; 52 52 this.performedDrag = false; … … 60 60 var newCenter = this.map.getLonLatFromViewPortPx( evt.xy ); 61 61 this.map.setCenter(newCenter, this.map.zoom + 1); 62 Event.stop(evt);62 OpenLayers.Event.stop(evt); 63 63 return false; 64 64 }, … … 68 68 */ 69 69 defaultMouseDown: function (evt) { 70 if (! Event.isLeftClick(evt)) return;70 if (!OpenLayers.Event.isLeftClick(evt)) return; 71 71 this.mouseDragStart = evt.xy.clone(); 72 72 this.performedDrag = false; … … 87 87 } 88 88 document.onselectstart=function() { return false; } 89 Event.stop(evt);89 OpenLayers.Event.stop(evt); 90 90 }, 91 91 … … 125 125 */ 126 126 defaultMouseUp: function (evt) { 127 if (! Event.isLeftClick(evt)) return;127 if (!OpenLayers.Event.isLeftClick(evt)) return; 128 128 if (this.zoomBox) { 129 129 this.zoomBoxEnd(evt); … … 218 218 // first determine whether or not the wheeling was inside the map 219 219 var inMap = false; 220 var elem = Event.element(e);220 var elem = OpenLayers.Event.element(e); 221 221 while(elem != null) { 222 222 if (this.map && elem == this.map.div) { … … 250 250 251 251 //only wheel the map, not the window 252 Event.stop(e);252 OpenLayers.Event.stop(e); 253 253 } 254 254 }, trunk/openlayers/lib/OpenLayers/Control/MouseToolbar.js
r1477 r1588 9 9 * @requires OpenLayers/Control/MouseDefaults.js 10 10 */ 11 OpenLayers.Control.MouseToolbar = Class.create();11 OpenLayers.Control.MouseToolbar = OpenLayers.Class.create(); 12 12 OpenLayers.Control.MouseToolbar.X = 6; 13 13 OpenLayers.Control.MouseToolbar.Y = 300; 14 14 OpenLayers.Control.MouseToolbar.prototype = 15 O bject.extend( new OpenLayers.Control(),16 O bject.extend( new OpenLayers.Control.MouseDefaults(), {15 OpenLayers.Util.extend( new OpenLayers.Control(), 16 OpenLayers.Util.extend( new OpenLayers.Control.MouseDefaults(), { 17 17 18 18 mode: null, … … 69 69 btn.events.register("mousedown", this, this.buttonDown); 70 70 btn.events.register("mouseup", this, this.buttonUp); 71 btn.events.register("dblclick", this, Event.stop);71 btn.events.register("dblclick", this, OpenLayers.Event.stop); 72 72 btn.action = id; 73 73 btn.title = title; … … 84 84 */ 85 85 buttonDown: function(evt) { 86 if (! Event.isLeftClick(evt)) return;86 if (!OpenLayers.Event.isLeftClick(evt)) return; 87 87 this.buttonClicked = evt.element.action; 88 Event.stop(evt);88 OpenLayers.Event.stop(evt); 89 89 }, 90 90 … … 93 93 */ 94 94 buttonUp: function(evt) { 95 if (! Event.isLeftClick(evt)) return;95 if (!OpenLayers.Event.isLeftClick(evt)) return; 96 96 if (this.buttonClicked != null) { 97 97 if (this.buttonClicked == evt.element.action) { 98 98 this.switchModeTo(evt.element.action); 99 99 } 100 Event.stop(evt);100 OpenLayers.Event.stop(evt); 101 101 this.buttonClicked = null; 102 102 } … … 111 111 var newCenter = this.map.getLonLatFromViewPortPx( evt.xy ); 112 112 this.map.setCenter(newCenter, this.map.zoom + 1); 113 Event.stop(evt);113 OpenLayers.Event.stop(evt); 114 114 return false; 115 115 }, … … 119 119 */ 120 120 defaultMouseDown: function (evt) { 121 if (! Event.isLeftClick(evt)) return;121 if (!OpenLayers.Event.isLeftClick(evt)) return; 122 122 this.mouseDragStart = evt.xy.clone(); 123 123 this.performedDrag = false; … … 195 195 } 196 196 document.onselectstart = function() { return false; } 197 Event.stop(evt);197 OpenLayers.Event.stop(evt); 198 198 }, 199 199 … … 270 270 */ 271 271 defaultMouseUp: function (evt) { 272 if (! Event.isLeftClick(evt)) return;272 if (!OpenLayers.Event.isLeftClick(evt)) return; 273 273 switch (this.mode) { 274 274 case "zoombox": trunk/openlayers/lib/OpenLayers/Control/PanZoom.js
r1424 r1588 8 8 * @requires OpenLayers/Control.js 9 9 */ 10 OpenLayers.Control.PanZoom = Class.create();10 OpenLayers.Control.PanZoom = OpenLayers.Class.create(); 11 11 OpenLayers.Control.PanZoom.X = 4; 12 12 OpenLayers.Control.PanZoom.Y = 4; 13 13 OpenLayers.Control.PanZoom.prototype = 14 O bject.extend( new OpenLayers.Control(), {14 OpenLayers.Util.extend( new OpenLayers.Control(), { 15 15 16 16 /** @type int */ … … 102 102 */ 103 103 doubleClick: function (evt) { 104 Event.stop(evt);104 OpenLayers.Event.stop(evt); 105 105 return false; 106 106 }, … … 110 110 */ 111 111 buttonDown: function (evt) { 112 if (! Event.isLeftClick(evt)) return;112 if (!OpenLayers.Event.isLeftClick(evt)) return; 113 113 114 114 switch (this.action) { … … 136 136 } 137 137 138 Event.stop(evt);138 OpenLayers.Event.stop(evt); 139 139 }, 140 140 trunk/openlayers/lib/OpenLayers/Control/PanZoomBar.js
r1468 r1588 8 8 * @requires OpenLayers/Control/PanZoom.js 9 9 */ 10 OpenLayers.Control.PanZoomBar = Class.create();10 OpenLayers.Control.PanZoomBar = OpenLayers.Class.create(); 11 11 OpenLayers.Control.PanZoomBar.X = 4; 12 12 OpenLayers.Control.PanZoomBar.Y = 4; 13 13 OpenLayers.Control.PanZoomBar.prototype = 14 O bject.extend( new OpenLayers.Control.PanZoom(), {14 OpenLayers.Util.extend( new OpenLayers.Control.PanZoom(), { 15 15 16 16 /** @type Array(...) */ … … 148 148 */ 149 149 divClick: function (evt) { 150 if (! Event.isLeftClick(evt)) return;150 if (!OpenLayers.Event.isLeftClick(evt)) return; 151 151 var y = evt.xy.y; 152 var top = Position.page(evt.object)[1];152 var top = OpenLayers.Util.pagePosition(evt.object)[1]; 153 153 var levels = Math.floor((y - top)/this.zoomStopHeight); 154 154 this.map.zoomTo((this.map.getNumZoomLevels() -1) - levels); 155 Event.stop(evt);155 OpenLayers.Event.stop(evt); 156 156 }, 157 157 … … 161 161 */ 162 162 zoomBarDown:function(evt) { 163 if (! Event.isLeftClick(evt)) return;163 if (!OpenLayers.Event.isLeftClick(evt)) return; 164 164 this.map.events.register("mousemove", this, this.passEventToSlider); 165 165 this.map.events.register("mouseup", this, this.passEventToSlider); … … 167 167 this.zoomStart = evt.xy.clone(); 168 168 this.div.style.cursor = "move"; 169 Event.stop(evt);169 OpenLayers.Event.stop(evt); 170 170 }, 171 171 … … 179 179 if (this.mouseDragStart != null) { 180 180 var deltaY = this.mouseDragStart.y - evt.xy.y 181 var offsets = Position.page(this.zoombarDiv);181 var offsets = OpenLayers.Util.pagePosition(this.zoombarDiv); 182 182 if ((evt.clientY - offsets[1]) > 0 && 183 183 (evt.clientY - offsets[1]) < parseInt(this.zoombarDiv.style.height) - 2) { … … 186 186 } 187 187 this.mouseDragStart = evt.xy.clone(); 188 Event.stop(evt);188 OpenLayers.Event.stop(evt); 189 189 } 190 190 }, … … 196 196 */ 197 197 zoomBarUp:function(evt) { 198 if (! Event.isLeftClick(evt)) return;198 if (!OpenLayers.Event.isLeftClick(evt)) return; 199 199 if (this.zoomStart) { 200 200 this.div.style.cursor="default"; … … 205 205 this.moveZoomBar(); 206 206 this.mouseDragStart = null; 207 Event.stop(evt);207 OpenLayers.Event.stop(evt); 208 208 } 209 209 }, trunk/openlayers/lib/OpenLayers/Control/Permalink.js
r1537 r1588 8 8 * @requires OpenLayers/Control.js 9 9 */ 10 OpenLayers.Control.Permalink = Class.create();
