add smooth drag panning to yahoo layer. the trinity is united. killer props to cr5 for digging through and finding these. ladies and gentlemen, you now have *no*excuse* for not using openlayers. smooth and sexy GYM commercial layers. (Closes #1163)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@5230 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2007-11-21 08:22:39 +00:00
parent 9acb997b20
commit 82e43d743f
2 changed files with 29 additions and 1 deletions

View File

@@ -92,6 +92,13 @@ OpenLayers.Layer.Yahoo = OpenLayers.Class(
this.mapObject = new YMap(this.div, this.type, size);
this.mapObject.disableKeyControls();
this.mapObject.disableDragMap();
//can we do smooth panning? (moveByXY is not an API function)
if ( !this.mapObject.moveByXY ||
(typeof this.mapObject.moveByXY != "function" ) ) {
this.dragPanMapObject = null;
}
} catch(e) {}
},
@@ -248,6 +255,20 @@ OpenLayers.Layer.Yahoo = OpenLayers.Class(
return this.mapObject.getCenterLatLon();
},
/**
* APIMethod: dragPanMapObject
*
* Parameters:
* dX - {Integer}
* dY - {Integer}
*/
dragPanMapObject: function(dX, dY) {
this.mapObject.moveByXY({
'x': -dX,
'y': dY
});
},
/**
* APIMethod: getMapObjectZoom
*