POST
|
This is what I did, using code from samples posted and some editing. Built in FlexViewer 2.2 When users select one of these layers within the TOC, Bldg Quality Code, Depreciation, or Structure Code. Opens the Unique Neighborhood widget, enters number, clicks submit. Layer select is displayed for that Neighborhood only. Within Config.xml Use these three layers within the widget <layer label="Bldg Quality Code" type="feature" visible="false" alpha="0.4" mode="onDemand" url="http://gcgis/ArcGIS/rest/services/Monthly/NeighborhoodGroup/MapServer/8" /> <layer label="Depreciation" type="feature" visible="false" alpha="0.4" mode="onDemand" url="http://gcgis/ArcGIS/rest/services/Monthly/NeighborhoodGroup/MapServer/4" /> <layer label="Structure Code" type="feature" visible="false" alpha="0.4" mode="onDemand" url="http://gcgis/ArcGIS/rest/services/Monthly/NeighborhoodGroup/MapServer/6" /> <layer label="Parcel Info" type="feature" visible="false" alpha="0.4" mode="onDemand" url="http://gcgis/ArcGIS/rest/services/Daily/ParcelA/MapServer/2" /> <widget label="Unique Neighborhood" x="550" y="260" icon="assets/images/i_lego.png" config="widgets/Samples/LayerDefinition/LayerDefinition.xml" url="widgets/Samples/LayerDefinition/LayerDefinition.swf"/> Widget name LayerDefinition Two files: LayerDefinition.mxml & LayerDefinition.xml LayerDefinition.mxml <?xml version="1.0" encoding="utf-8"?> <!-- //////////////////////////////////////////////////////////////////////////////// // // LayerDefinition Widget for FlexViewer 2.2 // //////////////////////////////////////////////////////////////////////////////// --> <viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:esri="http://www.esri.com/2008/ags" xmlns:viewer="com.esri.viewer.*" widgetConfigLoaded="init()"> <fx:Script> <![CDATA[ import com.esri.ags.layers.FeatureLayer; import com.esri.ags.layers.Layer; import com.esri.viewer.AppEvent; import com.esri.viewer.ViewerContainer; import flash.utils.flash_proxy; import mx.controls.Alert; [Bindable] private var oplList:Array; //this function called when the widget's configuration is loaded private function init():void { if (configXML) // checking for valid content in the configuration file { fieldlbl.text = configXML.field = "NBHDNUM"; } } private function submitButton_clickHandler(event:Event):void { ViewerContainer.dispatchEvent(new AppEvent(AppEvent.DATA_OPT_LAYERS, null, getOplayers)); } private function getOplayers(event:AppEvent):void { oplList = event.data as Array; if (oplList && oplList.length > 0) { for (var j:int = 0; j < oplList.length; j++) { var opLayerName:String = oplList .label; if (opLayerName == "Bldg Quality Code" || opLayerName == "Depreciation" || opLayerName == "Structure Code") { //Alert.show(opLayerName); oplList .layer.definitionExpression = configXML.field + "='" + definitionText.text + "'"; //Alert.show(oplList .layer.definitionExpression); } } } } ]]> </fx:Script> <viewer:WidgetTemplate id="layerDefinition" width="235" height="150"> <viewer:layout> <s:VerticalLayout horizontalAlign="center" verticalAlign="middle"/> </viewer:layout> <s:Label id="fieldlbl"/> <s:TextInput id="definitionText"/> <s:Button label="Submit" click="submitButton_clickHandler(event)"/> </viewer:WidgetTemplate> </viewer:BaseWidget> LayerDefinition.xml <configuration> <layer>Bldg Quality Code</layer> <field>BLDQUAL_CODE</field> <field>DEPR</field> <field>STRCODE</field> <field>AKPAR</field> <layer>Depreciation</layer> <field>BLDQUAL_CODE</field> <field>DEPR</field> <field>STRCODE</field> <field>AKPAR</field> <layer>Structure Code</layer> <field>BLDQUAL_CODE</field> <field>DEPR</field> <field>STRCODE</field> <field>AKPAR</field> </configuration>
... View more
08-15-2012
03:55 AM
|
0
|
0
|
308
|
POST
|
Below is working with multiple relates, relates are one too many. eSearch works... <layer> <definitionexpression></definitionexpression> <enableexport>true</enableexport> <name>Relate Search</name> <url>http://gcgis/ArcGIS/rest/services/MyRelate/MapServer/0</url> <expressions> <expression alias="Parcel Number" textsearchlabel=""> <values> <value prompt="Parcel Number Example: 150758">AKPAR = '[value]'</value> </values> </expression> </expressions> <graphicalsearchlabel>Use one of the graphical search tools to select Roads</graphicalsearchlabel> <spatialsearchlayer>true</spatialsearchlayer> <titlefield>AKPAR</titlefield> <fields all="false"> <field name="AKPAR" alias="PID #" gridfield="true"/> <field name="PIN" alias="PIN #" gridfield="true"/> <field name="CALCAC" alias="Calculated Acres" gridfield="true"/> </fields> <links> <link> </link> </links> <zoomscale usegeometry="true" zoompercent="1.6" /> <autoopendatagrid>false</autoopendatagrid> <relates> <relate id="0" label="Building Summary" enableexport="true" icon="assets/images/i_hydro.png"> <fields all="true" /> </relate> <relate id="1" label="Sale Summary" enableexport="true" icon="assets/images/i_hydro.png"> <fields all="true" /> </relate> <relate id="2" label="Tax Work" enableexport="true" icon="assets/images/i_hydro.png"> <fields all="true" /> </relate> <relate id="3" label="AS400 Out" enableexport="true" icon="assets/images/i_hydro.png"> <fields all="true" /> </relate> <relate id="4" label="Mobile Video Images" enableexport="true" icon="assets/images/i_hydro.png"> <fields all="false"> <field name="Parcel" alias="Parcel" /> <field name="ImagePath" alias="House Picture" hyperlinkgridfield="true"/> </fields> </relate> </relates> <queryattachments>false</queryattachments> </layer>
... View more
08-14-2012
11:10 AM
|
0
|
0
|
541
|
POST
|
This works! Expression: zoomToSelectedFeatures() import arcpy def zoomToSelectedFeatures(): mxd = arcpy.mapping.MapDocument('CURRENT') df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0] df.zoomToSelectedFeatures() arcpy.RefreshActiveView()
... View more
02-13-2012
10:02 AM
|
2
|
1
|
903
|
POST
|
This code works; zooms to but gives this error message that you have to close. import arcpy mxd = arcpy.mapping.MapDocument('CURRENT') df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0] Layer = (mxd, "PUBLICGIS.GISADMIN.PARCELCAMA", df)[0] df.zoomToSelectedFeatures() arcpy.RefreshActiveView ()
... View more
02-13-2012
08:17 AM
|
0
|
0
|
903
|
POST
|
Within the config.xml file we can set the position on the screen where the widget opens. How do you take into account monitor size? For example: I build a Flex Viewer application based on a 27??? monitor, deploy the application. Then users with a 19??? monitor can???t see some of the widget when they open. Any way to preserve the layout. absolute vs. relative?
... View more
09-29-2011
09:20 AM
|
0
|
2
|
468
|
POST
|
Take a look at this! From Tech Support: Every map service's config file has <MaxImageHeight> and <MaxImageWidth> properties set to 2048 by default. You will need to modify those values to be able to generate larger maps. I think 27 inch monitors have a resolution of 2560x1440 pixels. Restarting SOM afterwards should reflect the changes. Here is more documentation on this: http://help.arcgis.com/en/arcgisserv...00mr000000.htm
... View more
07-22-2011
09:17 AM
|
0
|
0
|
138
|
POST
|
I would like to calculate and label the the polyline measurements by indivual segments. Has anyone attempted this yet?
... View more
07-08-2011
12:35 PM
|
0
|
0
|
301
|
POST
|
Is it possible to set/change the time limit to the mouse-over tips? Currently it???s only a few seconds I would like to extend this time. Great job Robert!
... View more
06-30-2011
05:03 AM
|
0
|
9
|
566
|
POST
|
Changed from: .xml <spatialref>26913</spatialref> to <spatialref>2264</spatialref> .mxml to private var spatialref:Number = 2264; Seems to work fine now.
... View more
03-11-2011
12:09 PM
|
0
|
0
|
377
|
POST
|
Version 2.2.4 - 02/24/2011 Info on previous versions is in the ReadMe.txt Getting error on double click to end measure tool. Occurs after sitting idle for a few minutes. [FaultEvent fault=[RPC Fault faultString="Unexpected < encountered" faultCode="null" faultDetail="null"] messageId=null type="fault" bubbles=false cancelable=true eventPhase=2]
... View more
03-11-2011
11:34 AM
|
0
|
0
|
377
|
POST
|
Thank you so much, this helps me understand the communication process and gets the definition expression working.
... View more
03-09-2011
04:02 AM
|
0
|
0
|
305
|
POST
|
Thanks for the reply. I can preset using this in the config: <layer label="NeighborhoodbyBldgQualityCode" type="feature" visible="false" alpha="1" definitionexpression="NBHDNUM='5b097'" url="http://gcgis/ArcGIS/rest/services/Monthly/NeighborhoodbyBldgQualityCode/MapServer/0" /> How can I send the NBHDNUM='5b097' from my user input into the config.xml? private function doSearchBldgQualityCode():void { NeighborhoodbyBldgQualityCode.definitionExpression = "NBHDNUM ='" + qTextBldgQualityCode.text + "'"; }
... View more
03-08-2011
11:32 AM
|
0
|
0
|
305
|
POST
|
Within a Flex APP. Building a definition Expression from user into and tying it together is no big deal. I would like to do this in the Flex Viewer. How do I send the user input from my widger to a featurelayer within the Config.xml?
... View more
03-08-2011
10:38 AM
|
0
|
4
|
2522
|
POST
|
Within a Flex APP. Building a definition Expression and tying it together is no big deal. I would like to do this in the Flex Viewer. How do I send this to a featurelayer within the Config.xml?
... View more
03-08-2011
10:34 AM
|
0
|
0
|
480
|
Title | Kudos | Posted |
---|---|---|
2 | 02-13-2012 10:02 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|