fix for #191 - graceful dealing with setCenter() on lonlat out of maxexteng (on first setcenter() call). added test

git-svn-id: http://svn.openlayers.org/trunk/openlayers@1585 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-10-05 06:20:47 +00:00
parent fcc84782df
commit 33c37ef78b
2 changed files with 18 additions and 0 deletions

View File

@@ -576,6 +576,11 @@ OpenLayers.Map.prototype = {
* trigger movestart/end events
*/
setCenter: function (lonlat, zoom, dragging) {
if (!this.center && !this.isValidLonLat(lonlat)) {
lonlat = this.maxExtent.getCenterLonLat();
}
var zoomChanged = (this.isValidZoomLevel(zoom)) &&
(zoom != this.getZoom());