I have about 60 pngs that I'd like to place on my map as
GroundOverlays. I am comfortable doing this one at a time but know it
would be more efficient to loop the whole process.
My questions are
1) Do I need to create a new loader for each overlay that I'd like to
add?
2) Should I create a string that has every filename in it and iterate
through that list to create loaders, groundOverlay etc.? I know this
is wrong but something like the code below. Can anyone get me started
on looping the creation of all the loaders and overlays?
//create loaders for each png in pngfilelist
function createloaders():void{
for(var i:uint=0;i<pngfilelist.length();i++){
var ld:Loader = new Loader(pngfilelist[i].name);
ld.ivar = i;
}
3) Should I just load and create overlays one at a time or is that a
huge waste of time? Should I just buck up and get more comfortable
creating loops etc?
4) Finally, once they are all loaded, I am going to make them visible
through different buttons/slider queries. Is there a command to
remove all overlays? To remove a unique overlay I use
map.removeOverlay(overlayName);.
Thanks in advance.
-j
ps. here's the code I've used to load one overlay. I'd like to do
the exact same thing, just with a string of 60 files.
function impimages(event:Event):void
{
var testLoader:Loader = new Loader();
var urlRequest:URLRequest = new URLRequest("compsmall.png");
testLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
function(e:Event):void
{
var groundOverlay:GroundOverlay = new GroundOverlay(testLoader,
//first is bottom left, second is top right
new LatLngBounds(new LatLng(46.669, -115.035), new
LatLng(48.995,-112.079)));
//function to add overlay
control.MXT_BTN.addEventListener(MouseEvent.CLICK, mxt_addover);
clear_btn.addEventListener(MouseEvent.CLICK, mxt_rmvover);
function mxt_addover(event:MouseEvent):void
{
map.addOverlay(groundOverlay);
}
});
testLoader.load(urlRequest);
}
--
You received this message because you are subscribed to the Google Groups
"Google Maps API For Flash" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api-for-flash?hl=en.