zoukankan      html  css  js  c++  java
  • 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;
                    }
                }
            }
         }
      }
    }
  • 相关阅读:
    根据某字符(字符串)分割字符串
    call函数心得
    Git之常用命令
    ES6之async与await
    CSS之 sass、less、stylus 预处理器的使用方式
    JavaScript之继承
    vue之keep-alive的使用
    CSS之单行、多行文本溢出显示省略号
    Vue之 watch、computed、filter之间的区别与使用场景
    Vue之watch监听对象中某个属性的方法
  • 原文地址:https://www.cnblogs.com/gisdream/p/1895959.html
Copyright © 2011-2022 走看看