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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user