Changeset 6998
- Timestamp:
- 04/23/08 06:46:39 (9 months ago)
- Files:
-
- sandbox/bartvde/cursor/examples/cursor.html (modified) (1 diff)
- sandbox/bartvde/cursor/lib/OpenLayers/Control/DragPan.js (modified) (1 diff)
- sandbox/bartvde/cursor/lib/OpenLayers/Handler.js (modified) (2 diffs)
- sandbox/bartvde/cursor/lib/OpenLayers/Handler/Drag.js (modified) (2 diffs)
- sandbox/bartvde/cursor/theme/default/img/pan.cur (added)
- sandbox/bartvde/cursor/theme/default/img/pandown.cur (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/bartvde/cursor/examples/cursor.html
r6992 r6998 73 73 new OpenLayers.Control.ZoomBox({title:"Zoom out box", displayClass: 'olControlZoomOutBox', out: true, cursor: 'url(../theme/default/img/zoomout.cur),auto'}), 74 74 new OpenLayers.Control.DragPan( 75 {title:'Drag map', cursor: ' move'})75 {title:'Drag map', cursor: 'url(../theme/default/img/pan.cur),auto', handlerOptions: {cursors: {mousedown: 'url(../theme/default/img/pandown.cur),auto', mouseup: 'url(../theme/default/img/pan.cur),auto' } }}) 76 76 ]); 77 77 map.addControl(panel); sandbox/bartvde/cursor/lib/OpenLayers/Control/DragPan.js
r6833 r6998 36 36 draw: function() { 37 37 this.handler = new OpenLayers.Handler.Drag(this, 38 {"move": this.panMap, "done": this.panMapDone}); 38 {"move": this.panMap, "done": this.panMapDone}, 39 this.handlerOptions); 39 40 }, 40 41 sandbox/bartvde/cursor/lib/OpenLayers/Handler.js
r5614 r6998 45 45 46 46 /** 47 * APIProperty: cursors 48 * {Array} an array specifying the mouse cursors to use on the map div 49 */ 50 cursors: null, 51 52 /** 47 53 * Property: map 48 54 * {<OpenLayers.Map>} … … 222 228 this.map.events.unregister(name, this, this.setEvent); 223 229 }, 230 231 /** 232 * Method: setCursor 233 * Set the mouse cursor on the map div 234 * 235 * Parameters: 236 * functionName - {String} the name of the function (e.g. mousedown) 237 */ 238 setCursor: function(functionName) { 239 if (this.cursors && this.cursors[functionName]) { 240 this.map.div.style.cursor = this.cursors[functionName]; 241 } 242 }, 224 243 225 244 /** sandbox/bartvde/cursor/lib/OpenLayers/Handler/Drag.js
r6992 r6998 155 155 */ 156 156 mousedown: function (evt) { 157 this.setCursor('mousedown'); 157 158 var propagate = true; 158 159 this.dragging = false; … … 216 217 */ 217 218 mouseup: function (evt) { 219 this.setCursor('mouseup'); 218 220 if (this.started) { 219 221 var dragged = (this.start != this.last);
