config.xml文件的配置如下:

<widget right="20" top="55"
config="widgets/MapSwitcher/MapSwitcherWidget.xml" url="widgets/MapSwitcher/MapSwitcherWidget.swf" />

源代码目录如下:

该模块的源代码原理解析,详细的代码在下载的开源flexviewer自带的:

大概的思路如下:MapSwitcherWidget.xml是模块的配置文件,MapSwitcherWidget.mxml是widget;

MapSwitcherWidget.xml:layerlist是图层列表里面的图层数据,excludelayer是选择排除的图层

 <?xml version="1.0" ?>
<configuration>
<layerlist visible="true">
<!-- <excludelayer>The Label Of Some Layer In Main Config File</excludelayer> -->
</layerlist>
</configuration>

config.xml文件:map节点里面配置

 <operationallayers>
<layer label="企业" type="feature" visible="false" alpha="1.0"
url="http://localhost:6080/arcgis/rest/services/nsBusiness/FeatureServer/7"
popupconfig="popups/PopUp_Ecoomy.xml">
</layer>
<layer label="物资装备" type="feature" visible="false" alpha="1.0"
url="http://localhost:6080/arcgis/rest/services/nsBusiness/FeatureServer/2"
popupconfig="popups/PopUp_Materials_equipment.xml">
</layer>
<layer label="庇护场所" type="feature" visible="true" alpha="1.0"
url="http://localhost:6080/arcgis/rest/services/nsBusiness/FeatureServer/4"
popupconfig="popups/PopUp_Refuge.xml">
</layer>
<layer label="保护对象" type="feature" visible="true" alpha="1.0"
url="http://localhost:6080/arcgis/rest/services/nsBusiness/FeatureServer/5"
popupconfig="popups/PopUp_Protection.xml">
</layer>
<layer label="应急仓库" type="feature" visible="false" alpha="1.0"
url="http://localhost:6080/arcgis/rest/services/nsBusiness/FeatureServer/6"
popupconfig="popups/PopUp_Warehouse.xml">
</layer>
<layer label="救援队伍" type="feature" visible="false" alpha="1.0"
url="http://localhost:6080/arcgis/rest/services/nsBusiness/FeatureServer/3"
popupconfig="popups/PopUp_Rescue_teams.xml">
</layer>
<layer label="应急专家" type="feature" visible="false" alpha="1.0"
url="http://localhost:6080/arcgis/rest/services/nsBusiness/FeatureServer/1"
popupconfig="popups/PopUp_Experts.xml">
</layer>
<layer label="危险隐患" type="feature" visible="true" alpha="1.0"
url="http://localhost:6080/arcgis/rest/services/nsBusiness/FeatureServer/0"
popupconfig="popups/PopUp_DangerSource.xml">
</layer>
</operationallayers>

这里配置图层列表的具体图层数据

         <basemaps>
<layer label="南沙地图" type="tiled" visible="true" alpha="1" url="http://localhost:6080/arcgis/rest/services/ns_new/MapServer" />
</basemaps>

这里可以配置不同的切换底图

备注:

GIS技术交流QQ群:432512093

天津政府应急系统之GIS一张图(arcgis api for flex)讲解(五)地图切换以及图层显示模块的更多相关文章

  1. 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(一)GIS一张图的系统开发环境以及flexviewer框架

    系统的GIS功能实现是基于arcgis api for flex,首先附上系统的主界面图,接下来的是对主界面的模块功能详细讲解: 一.GIS环境软件安装 (1)arcgis desktop的安装,要是 ...

  2. 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(十)态势标绘模块

    config.xml文件的配置如下: <widget label="态势标绘" icon="assets/images/impact_area_over.png&q ...

  3. 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(八)资源搜索模块

    config.xml文件的配置如下: <widget label="资源搜索" icon="assets/images/public_impact_over.png ...

  4. 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(二)鹰眼模块

    讲解GIS功能模块实现之前,先大概说一下flexviewer的核心配置文件config.xml,系统额GIS功能widget菜单布局.系统的样式.地图资源等等都是在这里配置的,这里对flexviewe ...

  5. 天津政府应急系统之GIS一张图(arcgis api for flex)解说(二)鹰眼模块

    解说GIS功能模块实现之前,先大概说一下flexviewer的核心配置文件config.xml,系统额GIS功能widget菜单布局.系统的样式.地图资源等等都是在这里配置的,这里对flexviewe ...

  6. 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(十三)台风模块

    config.xml文件的配置如下: <widget label="台风" icon="assets/images/typhoon.png" config ...

  7. 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(十一)路径导航模块

    config.xml文件的配置如下: <widget label="路径导航" icon="assets/images/lujingdaohang.png" ...

  8. 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(六)地图搜索模块

    config.xml文件的配置如下: <widget label="地图搜索" icon="assets/images/emergency_resource_ove ...

  9. 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(四)地图导航控件模块

    config.xml文件的配置如下: <widget left="10" top="50" config="widgets/Navigation ...

  10. 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(三)显示地图坐标系模块

    config.xml文件的配置如下: <widget left="3" bottom="3" config="widgets/Coordinat ...

随机推荐

  1. Sql Server系列:Select基本语句

    1 T-SQL中SELECT语法结构 <SELECT statement> ::= [WITH <common_table_expression> [,...n]] <q ...

  2. LINQ系列:LINQ to XML操作

    LINQ to XML操作XML文件的方法,如创建XML文件.添加新的元素到XML文件中.修改XML文件中的元素.删除XML文件中的元素等. 1. 创建XML文件 string xmlFilePath ...

  3. 【求助】WPF 在XP下 有的Textbox光标会消失

    最近做个项目,一直有一个问题没有解决,就是在XP下,有的Textbox里在文本框里没有东西的时候,会没有光标.不同的XP机器,失去光标的Textbox也不一样. 各位大师看下面的三张图,当Textbo ...

  4. Unity基础知识学习笔记一

      1,Unity 4.5.4这个版本,在打包ios应用程序的时候.会生成一个xcode工程,但是这个工程无法在xcode6上变异,无法生成ios8上发布.所以unity在ios8发布3天内就发了4. ...

  5. 深入学习jQuery选择器系列第六篇——过滤选择器之状态选择器

    × 目录 [1]焦点状态 [2]哈希状态 [3]动画状态[4]显隐状态 前面的话 过滤选择器的内容非常多,本文介绍过滤选择器的最后一部分——状态选择器 焦点状态 :focus :focus选择器选择当 ...

  6. karma单元测试入门

    学习angularjs,都会遇到karma单元测试,可是初学者面对复杂的测试配置往往不知从何入手,下面我们将抛开angularjs,单独使用两个js文件,完成一次测试入门. 0,karma原理

  7. Target-Action回调模式

    前面的博客中提到过回调的概念,是在OC通过协议来实现的回调,和Java中的接口的回调极为相似,下面来介绍另一种方法回调模式: Target-Action回调.首先我们来从字面意思来理解一下Target ...

  8. C#动态调用WCF接口,两种方式任你选。

    写在前面 接触WCF还是它在最初诞生之处,一个分布式应用的巨作. 从开始接触到现在断断续续,真正使用的项目少之又少,更谈不上深入WCF内部实现机制和原理去研究,最近自己做一个项目时用到了WCF. 从这 ...

  9. 【集合框架】JDK1.8源码分析之ArrayList(六)

    一.前言 分析了Map中主要的类之后,下面我们来分析Collection下面几种常见的类,如ArrayList.LinkedList.HashSet.TreeSet等.下面通过JDK源码来一起分析Ar ...

  10. 【LeetCode】Increasing Triplet Subsequence(334)

    1. Description Given an unsorted array return whether an increasing subsequence of length 3 exists o ...