Changeset 447

Show
Ignore:
Timestamp:
01/24/08 16:54:38 (8 months ago)
Author:
tom
Message:

merging tkdave's changes into trunk, let's call it 1.0

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/as3

    • Property svn:ignore changed from
      SampleClient1.swf
      SampleClient2.swf
      .project
      bin
      .actionScriptProperties
      html-template
      .settings
      to
      SampleClient1.swf
      SampleClient2.swf
      .as3_classpath
      .project
      .settings
      bin
      .actionScriptProperties
      html-template
  • trunk/as3/lib/com/modestmaps/core/MapExtent.as

    r354 r447  
    55package com.modestmaps.core 
    66{ 
    7         import flash.geom.Point; 
    87        import com.modestmaps.geo.Location; 
    9         import flash.net.LocalConnection; 
    108         
    119        public class MapExtent extends Object 
  • trunk/as3/lib/com/modestmaps/core/MarkerClip.as

    r357 r447  
    88        import com.modestmaps.Map; 
    99        import com.modestmaps.events.MapEvent; 
    10         import com.modestmaps.events.MarkerEvent; 
     10        //import com.modestmaps.events.MarkerEvent; 
    1111        import com.modestmaps.geo.Location; 
    1212         
     
    1616        import flash.geom.Point; 
    1717        import flash.utils.Dictionary; 
    18          
    19         /** This is different from the as2 version for now, because 
     18        //import flash.events.MouseEvent;        
     19 
     20    /** This is different from the as2 version for now, because 
    2021         *  it makes more sense to me if you give it a Sprite  
    2122         *  (or DisplayObject) to take care of rather than ask it to 
     
    3839            public function MarkerClip(map:Map) 
    3940            { 
     41                // client code can listen to mouse events on this clip 
     42                // to get all events bubbled up from the markers 
     43                buttonMode = false; 
     44                mouseEnabled = false; 
     45                mouseChildren = true; 
     46                                 
    4047                this.map = map; 
    4148                this.x = map.getWidth() / 2; 
    4249                this.y = map.getHeight() / 2; 
    43                 map.addEventListener(MarkerEvent.ENTER, onMapMarkerEnters); 
    44                 map.addEventListener(MarkerEvent.LEAVE, onMapMarkerLeaves); 
     50                //map.addEventListener(MarkerEvent.ENTER, onMapMarkerEnters); 
     51                //map.addEventListener(MarkerEvent.LEAVE, onMapMarkerLeaves); 
    4552                map.addEventListener(MapEvent.START_ZOOMING, onMapStartZooming); 
    4653                map.addEventListener(MapEvent.STOP_ZOOMING, onMapStopZooming); 
     
    5158                map.addEventListener(MapEvent.RESIZED, onMapResized); 
    5259                map.addEventListener(MapEvent.EXTENT_CHANGED, updateClips); 
    53            } 
    54              
    55            public function attachMarker(marker:DisplayObject, location:Location):void 
     60        } 
     61 
     62        public function attachMarker(marker:DisplayObject, location:Location):void 
    5663            { 
    5764                // TODO: optionally index markers and throw marker events? 
     
    7683            { 
    7784                return markersByName[id] as DisplayObject; 
     85            } 
     86             
     87            public function getMarkerLocation( marker:DisplayObject ) : Location { 
     88                return locations[marker]; 
    7889            } 
    7990             
     
    99110                var h:Number = map.getHeight() * 2; 
    100111                for each (var marker:DisplayObject in markers) { 
     112                     
     113                    // TODO: note, hidden markers are not updated, so when  
     114                    // revealing markers using visible=true, they may end up in the wrong spot ? 
    101115                    if (marker.visible) { 
    102116                        updateClip(marker); 
     
    122136            } 
    123137                     
    124           /** This uses addChild, and onMapMarkerLeaves uses removeChild,  
    125            *  so that you're free to mess with .visible=true/false 
    126            *  yourself if you want to filter markers  
    127            */ 
    128           private function onMapMarkerEnters(event:MarkerEvent):void 
    129           { 
    130               if (!getChildByName(event.marker)) { 
    131                       var marker:DisplayObject = getMarker(event.marker); 
    132                       if (marker) { 
    133                           addChild(marker); 
    134                       } 
    135               }  
    136           } 
    137  
    138           /** This uses removeChild, and onMapMarkerEnters uses removeChild,  
    139            *  so that you're free to mess with .visible=true/false 
    140            *  yourself if you want to filter markers  
    141            */ 
    142           private function onMapMarkerLeaves(event:MarkerEvent):void 
    143           { 
    144               if (getChildByName(event.marker)) { 
    145                       var marker:DisplayObject = getMarker(event.marker); 
    146                       removeChild(marker); 
    147               }  
    148           } 
     138//        /** This uses addChild, and onMapMarkerLeaves uses removeChild,  
     139//         *  so that you're free to mess with .visible=true/false 
     140//         *  yourself if you want to filter markers  
     141//         */ 
     142//        private function onMapMarkerEnters(event:MarkerEvent):void 
     143//        { 
     144//            if (!getChildByName(event.marker)) { 
     145//                    var marker:DisplayObject = getMarker(event.marker); 
     146//                    if (marker) { 
     147//                        addChild(marker); 
     148//                    } 
     149//            }  
     150//        } 
     151// 
     152//        /** This uses removeChild, and onMapMarkerEnters uses removeChild,  
     153//         *  so that you're free to mess with .visible=true/false 
     154//         *  yourself if you want to filter markers  
     155//         */ 
     156//        private function onMapMarkerLeaves(event:MarkerEvent):void 
     157//        { 
     158//            if (getChildByName(event.marker)) { 
     159//                    var marker:DisplayObject = getMarker(event.marker); 
     160//                    removeChild(marker); 
     161//            }  
     162//        } 
    149163                     
    150164            private function onMapStartPanning(event:MapEvent):void 
  • trunk/as3/lib/com/modestmaps/core/MarkerSet.as

    r292 r447  
    88        import com.modestmaps.core.Coordinate; 
    99        import com.modestmaps.core.Marker; 
    10         import com.modestmaps.core.Tile; 
     10        //import com.modestmaps.core.Tile; 
    1111        import com.modestmaps.core.TileGrid; 
    1212 
  • trunk/as3/lib/com/modestmaps/core/TileGrid.as

    r357 r447  
    1717    import flash.geom.Rectangle; 
    1818    import flash.events.MouseEvent; 
    19     import flash.geom.Transform; 
    20     import flash.geom.Matrix; 
    2119    import flash.events.Event; 
    2220    import flash.display.Stage; 
     
    9290            _mapProvider = provider; 
    9391         
     92            cacheAsBitmap = true; 
     93                 
    9494            buildWell(); 
    9595            buildMask(); 
     
    679679                updateMarkers(); 
    680680                 
    681             trace("allocateTiles(): " + _tiles.length); 
     681            //trace("allocateTiles(): " + _tiles.length); 
    682682        } 
    683683         
     
    726726        protected function normalizeWell():void 
    727727        { 
    728             trace("normalizing well"); 
     728            //trace("normalizing well"); 
    729729            if(!_tiles) { 
    730730                return; 
     
    737737            centerWell(true); 
    738738     
    739                 trace("well scale: " + _well.scaleX + " " + _well.scaleY); 
     739                //trace("well scale: " + _well.scaleX + " " + _well.scaleY); 
    740740            if(Math.abs(_well.scaleX - 1.0) < 0.01) { 
    741741                active = activeTiles(); 
    742742             
    743743                // set to 100% if within 99% - 101% 
    744                 trace("scaling well to 100% from " + _well.scaleX*100 + "%"); 
     744                //trace("scaling well to 100% from " + _well.scaleX*100 + "%"); 
    745745                _well.scaleX = _well.scaleY = 1.0; 
    746746                 
     
    791791                } 
    792792             
    793                 trace('Scaled to '+zoomLevel+', '+(_well.scaleX*100.0)+'%'); 
     793                //trace('Scaled to '+zoomLevel+', '+(_well.scaleX*100.0)+'%'); 
    794794                markers.indexAtZoom(zoomLevel); 
    795795            } 
     
    813813        protected function splitTiles():void 
    814814        { 
    815             trace("splitting tiles"); 
     815            //trace("splitting tiles"); 
    816816            var condemnedTiles:/*Tile*/Array = []; 
    817817            var referenceTile:Tile, newTile:Tile; 
     
    878878        protected function mergeTiles():void 
    879879        { 
    880             trace("merging tiles"); 
     880            //trace("merging tiles"); 
    881881            var condemnedTiles:/*Tile*/Array = []; 
    882882            var referenceTile:Tile, newTile:Tile; 
     
    10081008            for (id in newOverlappingMarkers) { 
    10091009                if(newOverlappingMarkers[id] && !_overlappingMarkers[id]) { 
    1010                     _map.onMarkerEnters(id, markers.getMarker(id).location); 
     1010                    //_map.onMarkerEnters(id, markers.getMarker(id).location); 
    10111011                    _overlappingMarkers[id] = true; 
    10121012                } 
     
    10151015            for (id in _overlappingMarkers) { 
    10161016                if(!newOverlappingMarkers[id] && _overlappingMarkers[id]) { 
    1017                     _map.onMarkerLeaves(id, markers.getMarker(id).location); 
     1017                    //_map.onMarkerLeaves(id, markers.getMarker(id).location); 
    10181018                    delete _overlappingMarkers[id]; 
    10191019                } 
  • trunk/as3/lib/com/modestmaps/events/MapEvent.as

    r340 r447  
    88        import flash.geom.Point; 
    99        import com.modestmaps.core.MapExtent; 
    10         import com.modestmaps.geo.Location; 
    11         import com.modestmaps.core.Coordinate; 
     10        //import com.modestmaps.geo.Location; 
     11        //import com.modestmaps.core.Coordinate; 
    1212 
    1313        public class MapEvent extends Event 
  • trunk/as3/lib/com/modestmaps/events/MarkerEvent.as