Changeset 186
- Timestamp:
- 03/21/07 00:12:17 (2 years ago)
- Files:
-
- trunk/as2/lib/com/modestmaps/core/MarkerSet.as (modified) (3 diffs)
- trunk/as2/lib/com/modestmaps/core/Tile.as (modified) (1 diff)
- trunk/as2/lib/com/modestmaps/core/TileGrid.as (modified) (15 diffs)
- trunk/as2/lib/com/modestmaps/Map.as (modified) (10 diffs)
- trunk/as2/lib/SampleClient.as (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/as2/lib/com/modestmaps/core/MarkerSet.as
r177 r186 21 21 private var markerTiles:Object; 22 22 23 // for use of TileGrid.log()23 // for finding which is visible 24 24 private var grid:TileGrid; 25 25 … … 82 82 markerTiles[markerId][tileKey] = true; 83 83 84 // grid.log('Marker '+markerId+' in '+tileKey);84 //trace('Marker '+markerId+' in '+tileKey); 85 85 } 86 86 … … 124 124 } 125 125 126 // grid.log('Touched markers: '+ids.toString());126 //trace('Touched markers: '+ids.toString()); 127 127 return touched; 128 128 } trunk/as2/lib/com/modestmaps/core/Tile.as
r179 r186 150 150 public function paint(mapProvider:IMapProvider, tileCoord:Coordinate):Void 151 151 { 152 // grid.log("Painting tile: " + tileCoord.toString());152 //trace("Painting tile: " + tileCoord.toString()); 153 153 154 154 // set up the proper clip to paint here trunk/as2/lib/com/modestmaps/core/TileGrid.as
r179 r186 61 61 // Mask clip to hide outside edges of tiles. 62 62 private var mask:MovieClip; 63 64 // For testing purposes. 65 public var labelContainer:MovieClip; 66 public var label:TextField; 67 63 68 64 // Active when the well is being dragged on the stage. 69 65 private var wellDragTask:DelayedCall; … … 83 79 public function TileGrid() 84 80 { 85 this.createEmptyMovieClip( "labelContainer", getNextHighestDepth() );86 labelContainer.createTextField('label', 1, 10, 10, width-20, height-20);87 label = labelContainer["label"];88 label.selectable = false;89 label.textColor = 0xFF6600;90 91 81 buildWell(); 92 82 buildMask(); … … 184 174 allocateTiles(); 185 175 186 labelContainer.swapDepths( getNextHighestDepth() );187 188 176 // let 'em know we're coming 189 177 markers.indexAtZoom(zoomLevel); … … 195 183 { 196 184 var marker:Marker = new Marker(id, coord, location); 197 // log('Marker '+id+': '+coord.toString());185 //trace('Marker '+id+': '+coord.toString()); 198 186 markers.put(marker); 199 187 … … 223 211 224 212 centerWell(false); 225 226 /*227 // So the log is visible...228 var c:Color = new Color(well);229 var t:Object = c.getTransform();230 t.ra = 20;231 t.rb = 204;232 t.ga = 20;233 t.gb = 204;234 t.ba = 20;235 t.bb = 204;236 c.setTransform(t);237 */238 213 } 239 214 … … 278 253 tiles.push(tile); 279 254 280 // log('Created tile: '+tile.toString());255 //trace('Created tile: '+tile.toString()); 281 256 return tile; 282 257 } … … 287 262 private function destroyTile(tile:Tile):Void 288 263 { 289 // log('Destroying tile: '+tile.toString());264 //trace('Destroying tile: '+tile.toString()); 290 265 tiles.splice(tileIndex(tile), 1); 291 266 tile.cancelDraw(); … … 303 278 } 304 279 } 305 306 public function log(msg:String):Void 307 { 308 label.text += msg + '\n'; 309 label.scroll = label.maxscroll; 310 } 311 312 public function clearLog():Void 313 { 314 label.text = ''; 315 } 316 280 317 281 /* 318 282 * Reposition tiles and schedule a recursive call for the next frame. … … 461 425 max.y = well._y - max.y; 462 426 463 // log('min/max for drag: '+min+', '+max+' ('+topLeftOutLimit+', '+bottomRightInLimit+')');427 //trace('min/max for drag: '+min+', '+max+' ('+topLeftOutLimit+', '+bottomRightInLimit+')'); 464 428 465 429 // weird negative edge conditions, limit all movement on an axis … … 508 472 : bounds.max.y); 509 473 510 // log('Drag bounds would be: '+xMin+', '+yMin+', '+xMax+', '+yMax);474 //trace('Drag bounds would be: '+xMin+', '+yMin+', '+xMax+', '+yMax); 511 475 512 476 __startingWellPosition = new Point(well._x, well._y); 513 // log('Starting well position: '+__startingWellPosition.toString());477 //trace('Starting well position: '+__startingWellPosition.toString()); 514 478 515 479 map.onStartPan(); … … 551 515 normalizeWell(); 552 516 allocateTiles(); 553 // log('New well scale: '+well._xscale.toString());517 //trace('New well scale: '+well._xscale.toString()); 554 518 } 555 519 } … … 751 715 active[i]._y = active[0]._y + (active[i].coord.row - active[0].coord.row) * TILE_HEIGHT; 752 716 753 // log(active[i].toString()+' at '+active[i]._x+', '+active[i]._y+' vs. '+active[0].toString());717 //trace(active[i].toString()+' at '+active[i]._x+', '+active[i]._y+' vs. '+active[0].toString()); 754 718 } 755 719 … … 762 726 scaleAdjust = Math.pow(2, zoomAdjust); 763 727 764 // log('This is where we scale the whole well by '+zoomAdjust+' zoom levels: '+(100 / scaleAdjust)+'%');728 //trace('This is where we scale the whole well by '+zoomAdjust+' zoom levels: '+(100 / scaleAdjust)+'%'); 765 729 766 730 for(var i:Number = 0; i < zoomAdjust; i += 1) { … … 785 749 } 786 750 787 // log('Scaled to '+zoomLevel+', '+well._xscale+'%');751 //trace('Scaled to '+zoomLevel+', '+well._xscale+'%'); 788 752 markers.indexAtZoom(zoomLevel); 789 753 } … … 1179 1143 well.lineTo(width/-2, height/-2); 1180 1144 well.endFill(); 1181 1182 label.textColor = 0xFF6600;1183 label._width = width - 20;1184 label._height = height - 20;1185 1145 } 1186 1146 } trunk/as2/lib/com/modestmaps/Map.as
r184 r186 252 252 253 253 /* 254 grid.log('top left: '+corners[0].toString());255 grid.log('top right: '+corners[1].toString());256 grid.log('bottom left: '+corners[2].toString());257 grid.log('bottom right: '+corners[3].toString());254 trace('top left: '+corners[0].toString()); 255 trace('top right: '+corners[1].toString()); 256 trace('bottom left: '+corners[2].toString()); 257 trace('bottom right: '+corners[3].toString()); 258 258 */ 259 259 … … 506 506 public function putMarker(id:String, location:Location):Void 507 507 { 508 // grid.log('Marker '+id+': '+location.toString());508 //trace('Marker '+id+': '+location.toString()); 509 509 grid.putMarker(id, __mapProvider.locationCoordinate(location), location); 510 510 } … … 531 531 public function onMarkerEnters(id:String, location:Location):Void 532 532 { 533 // grid.log('+ '+marker.toString());533 //trace('+ '+marker.toString()); 534 534 dispatchEvent( EVENT_MARKER_ENTERS, id, location ); 535 535 } … … 546 546 public function onMarkerLeaves(id:String, location:Location):Void 547 547 { 548 // grid.log('- '+marker.toString());548 //trace('- '+marker.toString()); 549 549 dispatchEvent( EVENT_MARKER_LEAVES, id, location ); 550 550 } … … 558 558 public function onStartZoom():Void 559 559 { 560 // grid.log('Leaving zoom level '+grid.zoomLevel+'...');560 //trace('Leaving zoom level '+grid.zoomLevel+'...'); 561 561 dispatchEvent( EVENT_START_ZOOMING, grid.zoomLevel ); 562 562 } … … 570 570 public function onStopZoom():Void 571 571 { 572 // grid.log('...Entering zoom level '+grid.zoomLevel);572 //trace('...Entering zoom level '+grid.zoomLevel); 573 573 dispatchEvent( EVENT_STOP_ZOOMING, grid.zoomLevel ); 574 574 } … … 584 584 public function onZoomed(delta:Number):Void 585 585 { 586 // grid.log('Current well offset from start: '+delta.toString());586 //trace('Current well offset from start: '+delta.toString()); 587 587 dispatchEvent( EVENT_ZOOMED_BY, delta ); 588 588 } … … 595 595 public function onStartPan():Void 596 596 { 597 // grid.log('Starting pan...');597 //trace('Starting pan...'); 598 598 dispatchEvent( EVENT_START_PANNING ); 599 599 } … … 606 606 public function onStopPan():Void 607 607 { 608 // grid.log('...Stopping pan');608 //trace('...Stopping pan'); 609 609 dispatchEvent( EVENT_STOP_PANNING ); 610 610 } … … 620 620 public function onPanned(delta:Point):Void 621 621 { 622 // grid.log('Current well offset from start: '+delta.toString());622 //trace('Current well offset from start: '+delta.toString()); 623 623 dispatchEvent( EVENT_PANNED_BY, delta ); 624 624 } trunk/as2/lib/SampleClient.as
r177 r186 66 66 buttons.push(makeButton(__navButtons, 'down', 'pan down', Delegate.create(__map, __map.panDown))); 67 67 buttons.push(makeButton(__navButtons, 'left', 'pan right', Delegate.create(__map, __map.panRight))); 68 buttons.push(makeButton(__navButtons, 'clear', 'clear log', Delegate.create(__map.grid, __map.grid.clearLog)));69 68 70 69 //__navButtons._x = __navButtons._y = 50; … … 192 191 private static function onMarkerEnters( id : String, location : Location ):Void 193 192 { 194 __map.grid.log('+ '+id+' =)');193 trace('+ '+id+' =)'); 195 194 } 196 195 197 196 private static function onMarkerLeaves( id : String, location : Location ):Void 198 197 { 199 __map.grid.log('- '+id+' =(');198 trace('- '+id+' =('); 200 199 } 201 200 }
