Changeset 6411
- Timestamp:
- 02/29/08 01:03:12 (6 months ago)
- Files:
-
- trunk/openlayers/examples/animated_panning.html (modified) (3 diffs)
- trunk/openlayers/lib/OpenLayers/Map.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/examples/animated_panning.html
r6145 r6411 5 5 <style type="text/css"> 6 6 #map { 7 width: 512px; 8 height: 256px; 9 border: 1px solid black; 10 } 11 #map2 { 7 12 width: 512px; 8 13 height: 256px; … … 51 56 click.activate(); 52 57 map.addControl(new OpenLayers.Control.OverviewMap()); 58 59 map2 = new OpenLayers.Map('map2', {'panMethod': null} ); 60 layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", 61 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} ); 62 63 map2.addLayer(layer); 64 map2.zoomToMaxExtent(); 53 65 } 54 66 … … 77 89 <div id="map"></div> 78 90 <div id="docs"> 79 This is an example of transition effects. If the new random center is in the current extent, the map will pan smoothly. <br />91 <p>This is an example of transition effects. If the new random center is in the current extent, the map will pan smoothly. <br /> 80 92 The random selection will continue until you press it again. Additionally, you can single click in the map to pan smoothly 81 93 to that area, or use the pan control to pan smoothly. 82 94 </p> 83 95 </div> 84 96 <button onclick="setCenterInterval()">Start/stop random recenter</button> 97 <div id="map2"></div> 98 <div> 99 <p>To turn off Animated Panning, create a map with an panMethod set to 100 null. </p> 101 </div> 85 102 </body> 86 103 </html> trunk/openlayers/lib/OpenLayers/Map.js
r6398 r6411 327 327 328 328 /** 329 * Property: panMethod 330 * {Function} The Easing function to be used for tweening. Default is 331 * OpenLayers.Easing.Expo.easeOut. Setting this to 'null' turns off 332 * animated panning. 333 */ 334 panMethod: OpenLayers.Easing.Expo.easeOut, 335 336 /** 329 337 * Constructor: OpenLayers.Map 330 338 * Constructor for a new OpenLayers.Map instance. … … 1318 1326 */ 1319 1327 panTo: function(lonlat) { 1320 if (this. getExtent().containsLonLat(lonlat)) {1328 if (this.panMethod && this.getExtent().containsLonLat(lonlat)) { 1321 1329 if (!this.panTween) { 1322 this.panTween = new OpenLayers.Tween( OpenLayers.Easing.Expo.easeOut);1330 this.panTween = new OpenLayers.Tween(this.panMethod); 1323 1331 } 1324 1332 var center = this.getCenter();
