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;
                    }
                }
            }
         }
      }
    }
  • 相关阅读:
    腾讯2014 笔试
    iOS 并发编程之 Operation Queues
    iOS 架构
    loadView and viewDidLoad?
    Referring to weak self inside a nested block
    Weakify和strongify探究
    iOS开发的最佳实践
    iOS 书籍
    Object-C非正式协议与正式协议的区别
    解决element-ui中el-menu组件作为vue-router模式在刷新页面后default-active属性与当前路由页面不一致问题的方法
  • 原文地址:https://www.cnblogs.com/gisdream/p/1895959.html
Copyright © 2011-2022 走看看