Changeset 1585
- Timestamp:
- 10/05/06 02:20:47 (2 years ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Map.js (modified) (1 diff)
- trunk/openlayers/tests/test_Map.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Map.js
r1581 r1585 577 577 */ 578 578 setCenter: function (lonlat, zoom, dragging) { 579 580 if (!this.center && !this.isValidLonLat(lonlat)) { 581 lonlat = this.maxExtent.getCenterLonLat(); 582 } 583 579 584 var zoomChanged = (this.isValidZoomLevel(zoom)) && 580 585 (zoom != this.getZoom()); trunk/openlayers/tests/test_Map.html
r1424 r1585 248 248 } 249 249 250 function test_088_Map_setCenter(t) { 251 t.plan(1); 252 map = new OpenLayers.Map($('map')); 253 var baseLayer = new OpenLayers.Layer.WMS("Test Layer", 254 "http://octo.metacarta.com/cgi-bin/mapserv?", 255 {map: "/mapdata/vmap_wms.map", layers: "basic"}, 256 {maxResolution: 'auto', maxExtent: new OpenLayers.Bounds(-10,-10,10,10)}); 257 map.addLayer(baseLayer); 258 var ll = new OpenLayers.LonLat(-100,-150); 259 map.setCenter(ll, 0); 260 t.ok(map.getCenter().equals(new OpenLayers.LonLat(0,0)), "safely sets out-of-bounds lonlat"); 261 } 262 250 263 251 264 function test_99_Map_destroy (t) {
