flexviewer LayerListWidget,editwidget 应用纪要

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=">

<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>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值