Respecting fractional zoom when desired. Allowing string argument to map.zoomTo. r=bartvde (closes #2180)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10026 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2010-02-05 19:48:29 +00:00
parent 52f34e0baf
commit 2d61186deb
2 changed files with 48 additions and 2 deletions

View File

@@ -1576,7 +1576,13 @@ OpenLayers.Map = OpenLayers.Class({
moveTo: function(lonlat, zoom, options) {
if (!options) {
options = {};
}
}
if (zoom != null) {
zoom = parseFloat(zoom);
if (!this.fractionalZoom) {
zoom = Math.round(zoom);
}
}
// dragging is false by default
var dragging = options.dragging;
// forceZoomChange is false by default
@@ -1658,7 +1664,7 @@ OpenLayers.Map = OpenLayers.Class({
}
if (zoomChanged) {
this.zoom = parseInt(zoom);
this.zoom = zoom;
this.resolution = this.getResolutionForZoom(zoom);
// zoom level has changed, increment viewRequestID.
this.viewRequestID++;