flexiewer里遇到的一些问题

infoWindowRenderer问题 在arcgis api for flex中要设置infowindow的外观很容易,只需要在编写一下css文件即可,就如

esri|InfoWindow

{

border-thickness: 0;

background-color: green;

font-size: 16;   upper-left-radius: 15;

upper-right-radius: 0;   info-placement: top;

}

无论是直接使用Map的infowindow,还是通过infoWindowRenderer渲染器来设置Graphic的infowindow,或是使用FeatureLayer 的infoWindowRenderer来展现infowindow,通过上面的方法都是可以正常实现的。

但是如果你是使用flexviewer框架来设置infowindow外观,还是通过上面的方法,结果你会发现只能改改字体大小,字体颜色什么的, 并不能改变infowindow的外观(诸如背景),原因就在于flexviewer在框架里已经为你写了,并且infowindow的外观设置的跟你的应用 程序的外观是一样的,可以从代码里看出来,具体代码在  UIManager.as 里,可以找到

var cssStyleDeclarationInfoContainer:CSSStyleDeclaration = topLevelStyleManager.getStyleDeclaration("com.esri.ags.components.supportClasses.InfoWindow");

if (numberOfStyleColors > 4)

{

cssStyleDeclarationInfoContainer.setStyle("backgroundColor", backgroundColor);

cssStyleDeclarationInfoContainer.setStyle("borderColor", textColor);

}

backgroundColor可以再自己重新定义一个, 找到下面这个

if (numberOfStyleColors > 4)

{

textColor = configData.styleColors[0];

backgroundColor = configData.styleColors[1];

rolloverColor = configData.styleColors[2];

selectionColor = configData.styleColors[3];

titleColor = configData.styleColors[4];

applicationBackgroundColor = (configData.styleColors[5] != null) ? configData.styleColors[5] : 0xFFFFFF;

你定义的颜色值名称 = 配置文件的第几个颜色值;

}

然后再再配置文件(config.xml)里添加颜色值(即在style节点下面的color的节点里添加几个颜色值) 如果仔细看这个as文件的话,大概就会明白

同时当你把这个背景色改成你想要的颜色后,又出现个问题,infowindow的标题栏还是以前的颜色,这就需要你改另一处配置啦, 也是在这个as文件里

var cssStyleDeclarationContentNavigator:CSSStyleDeclaration = topLevelStyleManager.getStyleDeclaration("com.esri.ags.components.ContentNavigator"); if (numberOfStyleColors > 4)

{

cssStyleDeclarationContentNavigator.setStyle("headerBackgroundColor", backgroundColor);

cssStyleDeclarationContentNavigator.setStyle("headerColor", textColor);

} 设置这个跟上面的一样

通过官方给出的API关于com.esri.ags.components.ContentNavigator

The ContentNavigator is a generic container for UIComponents. It can be used as the content of the InfoWindow or used outside of the Map. You set its dataProvider with a list of components and they are displayed one at a time. If a component is a Graphic,  it looks for an infoWindowRenderer IFactory on the graphic or the graphic's graphicsLayer. If no infoWindowRenderer is found, it shows a default key-value data grid.

也就是说同时需要修改他的外观才能像在第一种方式设置的外观一样,甚至做的外观更美观

flexviewer infowindow背景问题的更多相关文章

  1. (一)FlexViewer之整体框架解析

    文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/. 1.FlexViewer简介 FlexViewer框架为Esri提供的 ...

  2. Android 百度地图 SDK v3.0.0 (三) 添加覆盖物Marker与InfoWindow的使用

    转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/37737213 上篇博客已经实现了地图的定位以及结合了方向传感器用户路痴定位方向, ...

  3. Android 百度地图 SDK v3.0.0 (三) 加入覆盖Marker与InfoWindow使用

    转载请注明出处:http://blog.csdn.net/lmj623565791/article/details/37737213 上篇博客已经实现了地图的定位以及结合了方向传感器用户路痴定位方向, ...

  4. 设置windows10 背景颜色

    [Win + R ] regedit 打开注册表 HKEY_CURRENT_USER\Control Panel\Colors 1.[InfoWindow] 默认为(白色):255 255 255, ...

  5. CSS3 background-image背景图片相关介绍

    这里将会介绍如何通过background-image设置背景图片,以及背景图片的平铺.拉伸.偏移.设置大小等操作. 1. 背景图片样式分类 CSS中设置元素背景图片及其背景图片样式的属性主要以下几个: ...

  6. 冒泡,setinterval,背景图的div绑定事件,匿名函数问题

    1.会冒泡到兄弟元素么? $(function(){ $("#a").click(function(){alert("a")}) $("#b" ...

  7. app引导页(背景图片切换加各个页面动画效果)

    前言:不知不觉中又加班到了10点半,整个启动页面做了一天多的时间,一共有三个页面,每个页面都有动画效果,动画效果调试起来麻烦,既要跟ios统一,又要匹配各种不同的手机,然后产品经理还有可能在中途改需求 ...

  8. CSS 3学习——box-sizing和背景

    box-sizing 在CSS 2中设置元素的width和height仅仅是设置了元素内容区的宽和高,元素实际的尺寸是margin + border + padding + 内容区. CSS 3(截止 ...

  9. .NET同步与异步之相关背景知识(六)

    在之前的五篇随笔中,已经介绍了.NET 类库中实现并行的常见方式及其基本用法,当然.这些基本用法远远不能覆盖所有,也只能作为一个引子出现在这里.以下是前五篇随笔的目录: .NET 同步与异步之封装成T ...

随机推荐

  1. Jenkins Slave Nodes – using the Swarm Plugin

    link: http://www.donaldsimpson.co.uk/2013/03/18/jenkins-slave-nodes-using-the-swarm-plugin/ I’ve bee ...

  2. 显示point data的时均值注意事项

    正确的导入顺序应该是: 先导入cell data,再做时均处理,最后再转换成point data.如果先转换成point data再做时均处理,速度会非常慢.

  3. 高阶篇:4.1.2)QFDII(设计要求逐层分配给各零件)

    本章目的:明确QFDII的作用:输入为设计要求(Design Feature),输出为零件特征(Part Characteristic),将设计要求分配到每一个零件特征中去: 本章开始介绍产品结构设计 ...

  4. 进阶篇:4.2.6)DFMEA故障库的建立与积累

    本章目的:DFMEA故障库的建立与积累. 1.故障库的认知 故障库是一种数据库,只是这个数据库中储存的是故障模式,也就是失效模式. 从前文DFMEA章节的学习中,我们可以知道,DFMEA对不同层级的失 ...

  5. CDH集群安装配置(六)CDH agent

    在线安装 sudo yum install cloudera-manager-agent cloudera-manager-daemons 离线安装 上传三个server的资源包到cdh1节点上(所有 ...

  6. 前端+php实现概率抽奖

    转前端之后,后台工程师大大跑路了只能兼任他的位置写点东西了 前端+后台抽奖代码网上一大堆,引用一位仁兄前面的代码(比较懒抱歉,后面数据处理,奖项判断是否抽完我将会标红,因为前面的代码网上太多了都能找到 ...

  7. EC20的短消息

    一 设置短消息的操作模式:AT+CMGF=<mode>  0=PDU,固定的16进制信息:=1文本模式. 二选择TE 字符集(+CSCS )AT+CSCS=<chset>字符集 ...

  8. POI基本操作

    1.读取excel文件 InputStream is = new FileInputStream(filesrc); POIFSFileSystem fs = new POIFSFileSystem( ...

  9. JBoss7.1.1远程无法访问

    一般情况下在JBoss7.1.1.Final版本中配置standalone/configuration/standalone.xml<interfaces>里面name为public的&l ...

  10. poj 2501 Average Speed

    Average Speed Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 4842   Accepted: 2168 Des ...