Changeset 455 for trunk/as3/lib/com/modestmaps/core/TileGrid.as
- Timestamp:
- 01/24/08 18:37:41 (8 months ago)
- Files:
-
- trunk/as3/lib/com/modestmaps/core/TileGrid.as (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/as3/lib/com/modestmaps/core/TileGrid.as
r447 r455 7 7 { 8 8 import com.modestmaps.Map; 9 import com.modestmaps.geo.Location; 9 10 import com.modestmaps.mapproviders.IMapProvider; 10 import com.modestmaps.core.*;11 import com.modestmaps.geo.Location;12 11 import com.stamen.twisted.*; 13 12 13 import flash.display.Sprite; 14 import flash.events.Event; 15 import flash.events.MouseEvent; 14 16 import flash.geom.Point; 15 import flash. display.Sprite;17 import flash.geom.Rectangle; 16 18 import flash.utils.Dictionary; 17 import flash.geom.Rectangle;18 import flash.events.MouseEvent;19 import flash.events.Event;20 import flash.display.Stage;21 19 22 20 public class TileGrid extends Sprite … … 216 214 _well.addEventListener(MouseEvent.MOUSE_DOWN, startWellDrag); 217 215 _well.addEventListener(MouseEvent.MOUSE_UP, stopWellDrag); 218 _well.addEventListener(MouseEvent.DOUBLE_CLICK, onWellDoubleClick);219 216 _well.doubleClickEnabled = true; 220 217 } … … 236 233 this.mask = _mask; 237 234 } 238 235 236 public function setDoubleClickEnabled(enabled:Boolean):void 237 { 238 if (enabled) { 239 _well.addEventListener(MouseEvent.DOUBLE_CLICK, onWellDoubleClick); 240 } 241 else if (_well.hasEventListener(MouseEvent.DOUBLE_CLICK)) { 242 _well.removeEventListener(MouseEvent.DOUBLE_CLICK, onWellDoubleClick); 243 } 244 } 239 245 240 246 public function getMapProvider():IMapProvider … … 454 460 var p:Point = new Point(event.localX, event.localY); 455 461 var l:Location = _map.pointLocation(p,_well); 456 _map. setCenter(l);462 _map.panTo(l); 457 463 } 458 464
