flexviewer infowindow背景问题
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背景问题的更多相关文章
- (一)FlexViewer之整体框架解析
文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/. 1.FlexViewer简介 FlexViewer框架为Esri提供的 ...
- Android 百度地图 SDK v3.0.0 (三) 添加覆盖物Marker与InfoWindow的使用
转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/37737213 上篇博客已经实现了地图的定位以及结合了方向传感器用户路痴定位方向, ...
- Android 百度地图 SDK v3.0.0 (三) 加入覆盖Marker与InfoWindow使用
转载请注明出处:http://blog.csdn.net/lmj623565791/article/details/37737213 上篇博客已经实现了地图的定位以及结合了方向传感器用户路痴定位方向, ...
- 设置windows10 背景颜色
[Win + R ] regedit 打开注册表 HKEY_CURRENT_USER\Control Panel\Colors 1.[InfoWindow] 默认为(白色):255 255 255, ...
- CSS3 background-image背景图片相关介绍
这里将会介绍如何通过background-image设置背景图片,以及背景图片的平铺.拉伸.偏移.设置大小等操作. 1. 背景图片样式分类 CSS中设置元素背景图片及其背景图片样式的属性主要以下几个: ...
- 冒泡,setinterval,背景图的div绑定事件,匿名函数问题
1.会冒泡到兄弟元素么? $(function(){ $("#a").click(function(){alert("a")}) $("#b" ...
- app引导页(背景图片切换加各个页面动画效果)
前言:不知不觉中又加班到了10点半,整个启动页面做了一天多的时间,一共有三个页面,每个页面都有动画效果,动画效果调试起来麻烦,既要跟ios统一,又要匹配各种不同的手机,然后产品经理还有可能在中途改需求 ...
- CSS 3学习——box-sizing和背景
box-sizing 在CSS 2中设置元素的width和height仅仅是设置了元素内容区的宽和高,元素实际的尺寸是margin + border + padding + 内容区. CSS 3(截止 ...
- .NET同步与异步之相关背景知识(六)
在之前的五篇随笔中,已经介绍了.NET 类库中实现并行的常见方式及其基本用法,当然.这些基本用法远远不能覆盖所有,也只能作为一个引子出现在这里.以下是前五篇随笔的目录: .NET 同步与异步之封装成T ...
随机推荐
- iframe自适应高度,多层嵌套iframe自适应高度的解决方法
在页面无刷新更新方面,虽然现在的ajax很强悍,但是处理代码相对多点.想比之下,iframe就简单多了!处理iframe的自适应宽.高,会经常用到,网上整理了一份,写在这里备用: 单个iframe 高 ...
- linux ssh 上传 文件
在linux下一般用scp这个命令来通过ssh传输文件. 1.从服务器上下载文件scp username@servername:/path/filename /var/www/local_dir(本地 ...
- 基础篇:3.3)规范化:3d装配图
本章目的:规范化3d零件装配图,弄清楚装配层级划分,这也是机械的基本功夫. 1.装配通用原则 在装配建模设计中,应遵循以下通用原则:a)所有的装配单元应具有唯一性和稳定性,不允许冗余元素存在: //就 ...
- Go语言命名
Go语言关键字 1.Go语言有25个关键字 2.关键字用途 var :用于变量的声明const :用于常量的声明type :用于声明类型func :用于声明函数和方法package :用于声明包文件i ...
- UML-6.1-用例-示例
1.总览要点:用例.摘要.非正式.详述.测试用例.用例分析与迭代联系起来. 2.示例:Process Sale 1).客户携带所购商品到达收银台. 2).收银员使用pos系统记录每件商品. 操作契约: ...
- Partition Array by Odd and Even
Partition an integers array into odd number first and even number second. Example Given [, , , ], , ...
- Java 数组算法列题解析
1.声明一个char类型的数组, 从键盘录入6个字符[1]遍历输出[2]排序[3]把char数组转化成一个逆序的数组 总结:分析问题时,先问自己,需要用到什么? 对于这题,第一步:先写一个main方 ...
- 关于typedef的用法
参考:http://www.cnblogs.com/csyisong/archive/2009/01/09/1372363.html https://wenda.so.com/q/1471668835 ...
- Python时间time模块介绍
一.明确时间元组 二.测试代码#!/usr/bin/env python # -- coding: utf-8 --' """ 时间模块,time的相关操作与测试 &qu ...
- Web测试注意事项
参考文章:http://www.51testing.com/html/07/n-3723307.html 总结下遇到的web测试的时候需要注意的地方: 页面分辨率: 通常是计算机的默认分辨率,但是还 ...