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;
                    }
                }
            }
         }
      }
    }
  • 相关阅读:
    文档API
    vi编辑器常用方法
    storm实战入门一
    redis教程
    为redis分配一个新的端口
    Lucene分页查询
    Lucene搜索方式大合集
    HBase Scan类用法
    java.util.Queue用法
    Makefile中预定义变量
  • 原文地址:https://www.cnblogs.com/gisdream/p/1895959.html
Copyright © 2011-2022 走看看