patch for smoother dragging of google layer. For now this remains a wierd (and admirable) hack... restricted to the use of v2.82 of the google api... but hot damn. it does work. hopefully the good folks at google might help us out and open this up as part of the API. Dinosaur egg kudos to cr5 for finding this and taking the time to plug it in. Thanks to tschaub for the quick review. (Closes #816)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@5224 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2007-11-20 22:21:54 +00:00
parent 3ae69b0789
commit 0e53fa10bf
3 changed files with 92 additions and 2 deletions

View File

@@ -225,8 +225,16 @@ OpenLayers.Layer.EventPane = OpenLayers.Class(OpenLayers.Layer, {
!(newZoom == oldZoom) ) {
var center = this.getMapObjectLonLatFromOLLonLat(newCenter);
var zoom = this.getMapObjectZoomFromOLZoom(newZoom);
this.setMapObjectCenter(center, zoom);
if (dragging && this.dragPanMapObject) {
var res = this.map.resolution; //readability
var dX = (newCenter.lon - oldCenter.lon) / res;
var dY = (newCenter.lat - oldCenter.lat) / res;
this.dragPanMapObject(dX, dY);
} else {
var zoom = this.getMapObjectZoomFromOLZoom(newZoom);
this.setMapObjectCenter(center, zoom, dragging);
}
}
}
}