function JoyZoomInterface(map) { this.map = map; // map interface object this.elJoyUp = null; this.elJoyRight = null; this.elJoyDown = null; this.elJoyLeft = null; this.elZoomPlus = null; this.elZoomMinus = null; this.drgZoomRider = null; this._create = function() { this.elJoyUp = document.getElementById('joyzoomup'); this.elJoyRight = document.getElementById('joyzoomright'); this.elJoyDown = document.getElementById('joyzoomdown'); this.elJoyLeft = document.getElementById('joyzoomleft'); this.elZoomPlus = document.getElementById('joyzoomplus'); this.elZoomMinus = document.getElementById('joyzoomminus'); this.attachEvents(); } this.onClickJoyUp = function() { this.map.panDirection(0, 1); } this.onClickJoyDown = function() { this.map.panDirection(0, -1); } this.onClickJoyLeft = function() { this.map.panDirection(-1, 0); } this.onClickJoyRight = function() { this.map.panDirection(1, 0); } this.onClickZoomPlus = function() { this.map.zoomIn(); } this.onClickZoomMinus = function() { this.map.zoomOut(); } this.attachEvents = function() { if (this.elJoyUp) { $(this.elJoyUp).bind('click', jQuery.proxy(this.onClickJoyUp, this)); } if (this.elJoyRight) { $(this.elJoyRight).bind('click', jQuery.proxy(this.onClickJoyRight, this)); } if (this.elJoyDown) { $(this.elJoyDown).bind('click', jQuery.proxy(this.onClickJoyDown, this)); } if (this.elJoyLeft) { $(this.elJoyLeft).bind('click', jQuery.proxy(this.onClickJoyLeft, this)); } if (this.elZoomPlus) { $(this.elZoomPlus).bind('click', jQuery.proxy(this.onClickZoomPlus, this)); } if (this.elZoomMinus) { $(this.elZoomMinus).bind('click', jQuery.proxy(this.onClickZoomMinus, this)); } } this._create(); }