Skip to main content
Known Participant
February 24, 2011
Question

Google Maps Smoothing

  • February 24, 2011
  • 1 reply
  • 497 views

So I've added a simple google map and all seemed good until I resized the swf, then all the text gets pretty rough.

I run the HTML Publish dimensions settings at 100% so that the site looks exactly the same no matter what the viewers screen resolution is.

I thought applying smoothing would solve the problem (I still think it will), but I can't seem to figure out where to put the code. I hoped I could apply it to my_map but it just gives me the 1119: Access of possibley indefined ... Error.

Any thoughts would be appreciated.

Here's my code ...

==============

// Import google maps,overlays, and controls.
import com.google.maps.*;
import com.google.maps.overlays.*;
import com.google.maps.controls.*;

// Declare a google maps variable. I called it gomap.
var my_map:Map = new Map()
my_map.key = "my_key";
addChild( my_map);

//Set map size.
my_map.setSize(new Point(550, 400));

// Add listener to trigger the MapEvent function.
my_map.addEventListener(MapEvent.MAP_READY, onMapReady);


// Function to add controls and other variables
function onMapReady(event:Event):void
{

//enabled Scroll Wheel
my_map.enableScrollWheelZoom();

// position the navigation control
var nav_position:ControlPosition = new ControlPosition(ControlPosition.ANCHOR_TOP_LEFT, 40,40);
var myNavPos:NavigationControl = new NavigationControl();
myNavPos.setControlPosition(nav_position);
my_map.addControl(myNavPos);


// add the default map view control buttons at default positions...
my_map.addControl(new MapTypeControl());
my_map.addControl(new OverviewMapControl());

//center the map
my_map.setCenter(new LatLng(34.051522, -118.247223),10,MapType.NORMAL_MAP_TYPE);

}

==============

Thanks,

Ter

This topic has been closed for replies.

1 reply

Participant
June 3, 2011

/*

* lm referenced here is guttershark's LayoutManager

* https://github.com/beheadedmyway/guttershark

*/

private function smoothMap():void

{

     var level0:*=map.getChildAt(1).getChildAt(0);

     for(var i:int=0;i<lm.getAllChildren(level0).length;++i)

     {

          var level1:*=level0.getChildAt(i);

          for(var l:int=0;l<lm.getAllChildren(level1).length;++l)

          {

               var level2:*=level1.getChildAt(l);

               for(var k:int=0;k<lm.getAllChildren(level2).length;++k)

               {

                    var level3:*=level2.getChildAt(k);

                    for(var m:int=0;m<lm.getAllChildren(level3).length;++m)

                    {

                         var tileLoader:Loader=Loader(level3.getChildAt(m).getChildAt(0));

                         tileLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,tileLoaded);

                    }

               }

          }

     }

}

private function tileLoaded(e:Event):void

{

     Bitmap(e.currentTarget.content).smoothing=true;

}

BUT!!! the images come from http://mt1.google.com/ and the crossdomain does not allow access