Ticket #2156: 2156.patch
| File 2156.patch, 1.4 kB (added by tschaub, 9 months ago) |
|---|
-
tests/Map.html
old new 1297 1297 map.destroy(); 1298 1298 1299 1299 } 1300 1301 function test_panTo(t) { 1302 1303 t.plan(2); 1304 1305 var map = new OpenLayers.Map("map"); 1306 map.addLayer( 1307 new OpenLayers.Layer(null, {isBaseLayer: true}) 1308 ); 1309 map.setCenter(new OpenLayers.LonLat(0, 0), 0); 1310 1311 map.panTo(new OpenLayers.LonLat(1, 0)); 1312 t.eq(map.panTween.playing, true, "the map pan tween is playing before destroy"); 1313 1314 map.destroy(); 1315 t.ok(!map.panTween || !map.panTween.playing, "the map pan tween is not playing after destroy"); 1316 1317 } 1300 1318 1301 1319 </script> 1302 1320 </head> -
lib/OpenLayers/Map.js
old new 632 632 if (!this.unloadDestroy) { 633 633 return false; 634 634 } 635 636 // make sure panning doesn't continue after destruction 637 if(this.panTween && this.panTween.playing) { 638 this.panTween.stop(); 639 } 635 640 636 641 // map has been destroyed. dont do it again! 637 642 OpenLayers.Event.stopObserving(window, 'unload', this.unloadDestroy);
