Hi Levko!
without seeing your code you need to remove the loader of the old
image and replace it with the new
usually something like
if (imageLoader)
{
removeChild(imageLoader);
}
I am really talking about a MapType here (and not an image to load on
the map).
So, when I create the map, I associate a first MapType to display on the
map when the map gets initialized.
Then, I also add the MapTypes selection control to that map.
Then, when the user click on one of the MapType available (to switch to
another MapType), then that new MapType get loaded in the map, and get
displayed. However, my problem is that the previous (initial) MapType is
still "under" the new selected MapType. So, if some of my tiles have
some transparency, I see the previously loaded MapType instead of the
background (white color in my case).
So, I really want to remove that previously loaded MapType before
loading a new one.
So, I can get noticed when the MapType is changing by listening to the
MapEvent. MAPTYPE_CHANGED event. However, I have no clue at what to do
from there to remove that previously loaded MapType:
==============
map.addEventListener(MapEvent.MAPTYPE_CHANGED, onMapTypeChangedHandler);
private function onMapTypeChangedHandler(event:MapEvent):void
{
}
==============
I made some more tests, and I found that by zooming twice in any
direction, will "reset" the map, and remove that previously loaded
MapType. However, this is really not what i want to have to do to clear
the map :)
==============
private function onMapTypeChanged(event:MapEvent):void
{
var currentZoom:Number = this.map.getZoom();
if(currentZoom < 10)
{
this.map.setZoom(currentZoom + 2);
}
else
{
this.map.setZoom(currentZoom - 2);
}
}
==============
However, this probably means that there is a clear to clear it; but I
still have no clue at how (what to access to remove it).
So, thanks a lot for your help!
Take care,
Fred
--
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.