更换ESRI标志
// add this new import
import mx.core.UIComponent;
//add this new embed to Map manger at the top of the mxml under
the other private declarations
[Embed(source="com/esri/solutions/# exviewer/assets/images/power
ed_by_ME.png")]
private var myLogo:Class;
private var myLogo:Class;
//Add this new function to Map Manger
private function changeESRILogo(map : Map) : void {
for(var i : int = 0 ; i < map.numChildren ; i++){
var component : UIComponent =
map.getChildAt(i) as UIComponent;
if(component.className == "StaticLayer"){
for(var j : int = 0 ; j <
component.numChildren ; j++){
var stComponent : UIComponent =
component.getChildAt(j) as UIComponent;
if(stComponent.className == "Image"){
var img:Image = stComponent as Image;
if (img.source.toString().indexOf("logo") > 0){
img.source = myLogo;
return;
}
}
}
}
}
}
//add this to the MapLoadComplete function
changeESRILogo(map);
评论1