Enforcing existing zoomToExtent behavior.

The Map.html and WrapDateLine.html tests that check zoomToExtent were failing with the changes to this method.  These test changes make the expectations more explicit.  It is inconsistent to call wrapDateLine only in zoomToExtent, but this is the minimum change to get the tests passing again.  It would be more consistent to call wrapDateLine in the setCenter sequence.
This commit is contained in:
Tim Schaub
2011-10-11 21:14:07 -06:00
parent ea8404c3bd
commit 6af8178452
2 changed files with 77 additions and 45 deletions

View File

@@ -2226,7 +2226,7 @@ OpenLayers.Map = OpenLayers.Class({
// we got from it was wrong. So we take our new bounds and ask it
// for the center.
//
center = bounds.getCenterLonLat();
center = bounds.getCenterLonLat().wrapDateLine(maxExtent);
}
this.setCenter(center, this.getZoomForExtent(bounds, closest));
},