flex 中隐藏地图上的esri的logo的最彻底的方法(转)

  在使用flex开发arcgisserver的过程中,地图上会被默认的加上一个esri自己logo。一般情况下,比如用的是自己的服务,直接在地图属性中加上logovisible=“false”就可以隐藏logo了。但是如果使用的是在线的地图服务,或者非服务模式的地图,则没有效果。于是采取了两种方法来处理。第一个是强制去掉,第二个是用自己的logo遮住ESRI的logo,偷天换日。
第一种方法:
private function init():void//init是默认加载完毕后执行的函数
{
        reallyHideESRILogo(myMap);
}

import mx.core.UIComponent;
import mx.controls.Image;

private function reallyHideESRILogo(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){
                    stComponent.visible = false;
                    return;
                }
            }
        }
     }
  }
}

转载于:https://www.cnblogs.com/gisdream/archive/2010/12/04/1895959.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值