diff --git a/lib/OpenLayers/Layer/Yahoo.js b/lib/OpenLayers/Layer/Yahoo.js index e087d28f1f..8d0a6a8b73 100644 --- a/lib/OpenLayers/Layer/Yahoo.js +++ b/lib/OpenLayers/Layer/Yahoo.js @@ -1,7 +1,7 @@ // @require: OpenLayers/Layer.js // load Yahoo map control script -document.write(""); +document.write(""); /** * @class @@ -46,14 +46,14 @@ OpenLayers.Layer.Yahoo.prototype = Object.extend( new OpenLayers.Layer(), { if ((this.ymap != null) && (!this.dragging)) { var olCenter = this.map.getCenter(); - var gCenter = this.getYMapCenter(); + var yCenter = this.getYMapCenter(); var olZoom = this.map.getZoom(); - var gZoom = this.ymap.getZoomLevel(); + var yZoom = this.ymap.getZoomLevel(); - if ((!olCenter.equals(yCenter)) || ((olZoom +1) != yZoom)) { + if ((!olCenter.equals(yCenter)) || (( 16 - olZoom) != yZoom)) { this.ymap.drawZoomAndCenter(new YGeoPoint(olCenter.lat, olCenter.lon), - olZoom + 1); + 16 - olZoom); } } }, @@ -71,27 +71,22 @@ OpenLayers.Layer.Yahoo.prototype = Object.extend( new OpenLayers.Layer(), { // create GMap, hide nav controls this.ymap = new YMap(this.div); - this.moveTo(); +// this.moveTo(); // catch pans and zooms from GMap - var e = new YEvent(this.ymap, - "endpan", - catchPanZoom, - this); + YEvent.Capture(this.ymap, + EventsList.endPan, + this.catchPanZoom, + this); -/** // attach to the drag start and end and weŽll set a flag so that // we dont get recursivity. this is because the events fall through // the gmaps div and into the main layer div - GEvent.addListener(this.gmap, - "dragstart", - this.dragStart.bindAsEventListener(this)); - - GEvent.addListener(this.gmap, - "dragend", - this.dragEnd.bindAsEventListener(this)); - */ + YEvent.Capture(this.ymap, + EventsList.startPan, + this.dragStart, + this); }, @@ -102,23 +97,18 @@ OpenLayers.Layer.Yahoo.prototype = Object.extend( new OpenLayers.Layer(), { this.dragging = true; }, - /** - * @private - */ - dragEnd: function() { - this.dragging = false; - }, - /** * @private * * @param {event} e */ catchPanZoom: function(e) { + this.dragging = false; + var olCenter = this.getYMapCenter(); var yZoom = this.ymap.getZoomLevel(); - this.map.setCenter(olCenter, yZoom - 1); + this.map.setCenter(olCenter, 16 - yZoom); },