加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

flexviewer LayerListWidget,editwidget 应用纪要

发布时间:2020-12-15 04:10:37 所属栏目:百科 来源:网络整理
导读:config.xml下节点: operationallayers !---图层控制中的动态服务 -- ??layer url="http://127.0.0.1/ArcGIS/rest/services/MapName/MapServer" visible="true" type="dynamic" ??label=" MapName "/ ??layer label=" 海域名称 " type="feature" visible="fa

config.xml下节点:

<operationallayers>

<!---图层控制中的动态服务 -->
??<layer url="http://127.0.0.1/ArcGIS/rest/services/MapName/MapServer" visible="true" type="dynamic"
??label="MapName"/>
??<layer label="海域名称" type="feature" visible="false" alpha="1.0"? popupconfig="LT/Forms/HYMCPopUp.xml"
??????url="http://127.0.0.1/ArcGIS/rest/services/MapName2/FeatureServer/1"/>

<layer label="MapName3" type="feature" visible="false" alpha="1.0"? popupconfig="LT/Forms/HYMCPopUp.xml"
??????url="http://127.0.0.1/ArcGIS/rest/services/MapName2/FeatureServer/2"/>

?

LayerListWidget应用,首先可以过滤不需要显示在tree中的图层

海域名称

<configuration label="LayerList (example)">
??? <excludelayer>海域名称</excludelayer>

则后面LayerListWidget中只会用2个父节点:MapName,MapName3

其中MapName为dynamic服务所以对应的子图层可以隐藏显示,但是无法查看图层的具体属性

MapName3为FeatureServer的一个图层则popupconfig="LT/Forms/HYMCPopUp.xml" 为对应的鼠标点击后可以查看的对应属性

HYMCPopUp.xml:

<?xml version="1.0" ?>
<configuration>
??? <title>{海域名称}</title>
??? <fields>
??????? <field name="海域名称"/>
??????? <field name="海域划分" alias="海域划分:" visible="true"/>???????
??? </fields>
?<description><![CDATA[<p/>海域划分:<b>{海域划分}</b><b>              <a href="../Yzqsj_Detail.aspx?CMD=View&objectid={OBJECTID}" target="_blank">详细信息</a></b></p>]]></description>
?<showattachments>true</showattachments>
</configuration>

EditWidget应用,自定义编辑页面的情况下,首先需要建立一个组件HYMC.mxml 基于mx:Form

如下

<?xml version="1.0" encoding="utf-8"?>
<mx:Form xmlns:fx="http://ns.adobe.com/mxml/2009"
?? xmlns:s="library://ns.adobe.com/flex/spark"
?? xmlns:mx="library://ns.adobe.com/flex/mx"
?? creationPolicy="all" width="100%" height="100%">
?<fx:Declarations>
??<!-- 将非可视元素(例如服务、值对象)放在此处 -->
?</fx:Declarations>
?<mx:FormItem id="kmlnm" label="海域名称" indicatorGap="6" required="false" width="100%">
??<mx:TextInput id="kmlname" width="180" text="@{data.海域名称}">
??</mx:TextInput>
?</mx:FormItem>?
?<mx:FormItem label="海域划分" indicatorGap="6" required="false" width="100%">
??<mx:TextInput id="kmlname1" width="180" text="@{data.海域划分}">
??</mx:TextInput>
?</mx:FormItem>
</mx:Form>

在EditWidgetAttributeInspectorSkin.mxml中引用

import LT.Forms.*;
????
import LT.Forms.HYMC;

private var form1: LT.Forms.HYMC;

?

在EditWdiget.xml中如下:

<configuration>

?<forms> ??? <form value="LT.Forms.HYMC">海域名称</form>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读