POST
|
Hi Sofie, Do you figure out? I am also trying to use time widget with polygon file and got no luck so far. Wonder if the time aware functions in FLEX API supports this since all samples are using point data. Best, Xiaowen
... View more
04-15-2014
12:45 PM
|
0
|
0
|
540
|
POST
|
I've figured out the question above for showing field info for dynamic join . Here's the code for labledatarender <fx:Component> <esri:LabelDataRenderer label=" Details"> <s:VGroup paddingBottom="5" paddingLeft="5" paddingRight="5" paddingTop="5" > <fx:Script> <![CDATA[ import mx.utils.ObjectUtil; [Bindable] var fieldName:String = "ancestry.State"; ]]> </fx:Script> <s:Label text="ID: { data[fieldName]}"/> <s:Label text="Name: {data.states.ASIAN }"/> <!--<s:Label text = "data: {ObjectUtil.toString(data)}"/>--> <!--<s:Label text = "data: {ObjectUtil.toString(ObjectUtil.getClassInfo(data))}"/>--> </s:VGroup> </esri:LabelDataRenderer> </fx:Component> With this experience, layer with dynamic join should use customized labeldatarender instead of builtin popupinfo for arcgis viewer for flex. The trick is data[fieldName].
... View more
03-11-2013
08:36 AM
|
0
|
0
|
376
|
POST
|
Hello Anthony, I modified the sample mxml code to figure out the issue. Even though <s:Label text = "data: {ObjectUtil.toString(data)}"/> can successfully display the data, <s:Label text="ID: { data.ancestry.State}"/> won't show anything at all. I am wondering how can I define popupinfo by actionscript to show something like ObjectUtil.toString(data)? Thanks <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (c) 2010-2011 ESRI All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions. You may freely redistribute and use this sample code, with or without modification, provided you include the original copyright notice and use restrictions. See use restrictions in use_restrictions.txt. --> <s:Application 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" pageTitle="Dynamic layer - FeatureLayer"> <!-- Description: This sample demonstrates how to create a FeatureLayer using a dynamic layer (lakes) from a service that has a registered workspace. This demonstrates one of the new features in ArcGIS 10.1; adding layers on the fly through a dynamic workspace, which allows developers to add layers on the fly that do not exist in a service. The ArcGIS map service needs to have the Dynamic Layers capability turned on, and it also needs a registered workspace. The registered workspace will be of type (Database, File Geodatabase, Shapefile, or Raster), and once registered then you can access layers within the workspace. Note: This sample adds the layer as a client-side FeatureLayer, whereas the "Dynamic Workspace" sample uses the server-side method to add the layer to the map service. This sample uses client-side methods to symbolize the features, whereas the other sample uses server-side methods to add the layer and symbolize the features on the server. Documentation: For more information, see the API documentation. http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/layers/FeatureLayer.html http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/layers/FeatureLayer.html#source http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/renderers/SimpleRenderer.html http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/layers/supportClasses/LayerDataSource.html http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/layers/supportClasses/LayerDataSource.html#fields http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/layers/supportClasses/TableDataSource.html ArcGIS REST API documentation: http://resources.arcgis.com/en/help/rest/apiref/dynamicLayer.html http://resources.arcgis.com/en/help/rest/apiref/dataSource.html http://resources.arcgis.com/en/help/rest/apiref/layerSource.html ArcGIS for Server documentation: http://resources.arcgis.com/en/help/main/10.1/index.html#/About_dynamic_layers/0154000004zv000000/ --> <fx:Style> @namespace esri "http://www.esri.com/2008/ags"; esri|ContentNavigator { headerBackgroundColor: #0080FF; } </fx:Style> <fx:Script> <![CDATA[ import com.esri.ags.utils.JSONUtil; import mx.utils.ObjectUtil; ]]> </fx:Script> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> <!-- Lakes Layer Dynamic Layer Info --> <esri:LayerDataSource id="lakesLayerDataSource"> <!-- FeatureClass within the Dynamic Workspace (follow the link in the sample description for more information on dynamic workspaces) --> <esri:TableDataSource dataSourceName="ss6.gdb.Lakes" workspaceId="MyDatabaseWorkspaceIDSSR2"/> </esri:LayerDataSource> </fx:Declarations> <s:controlBarContent> <s:RichEditableText width="100%" editable="false"> This sample demonstrates how to create a dynamic join with a layer (states) in a map service to a table (ancestry) in a dynamic workspace. Click a record to see more information about a given state, <s:a href="http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/dynamicLayer?layer={JSONUtil.encode({ source: ancestryLayerDataSource })}" target="_blank">view the ancestry table</s:a>, or <s:a href="http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3" target="_blank">view the states layer</s:a>. </s:RichEditableText> </s:controlBarContent> <esri:Map id="map"> <esri:extent> <esri:Extent xmin="-13988193" ymin="3016128" xmax="-7432953" ymax="6450291"> <esri:SpatialReference wkid="102100"/> </esri:Extent> </esri:extent> <esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer"/> <esri:ArcGISDynamicMapServiceLayer id="censusMapServiceLayer" name="Ancestry by State" url="http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer"> <esri:dynamicLayerInfos> <!-- states layer id in the census map service --> <esri:DynamicLayerInfo layerId="3" defaultVisibility="true"> <esri:LayerDataSource id="dynamicLayerSource"> <esri:JoinDataSource joinType="esriLeftOuterJoin" leftTableKey="STATE_NAME" rightTableKey="State"> <esri:leftTableSource> <!-- states layer id in the census map service --> <esri:LayerMapSource id="statesLayerMapSource" mapLayerId="3"/> </esri:leftTableSource> <esri:rightTableSource> <esri:LayerDataSource id="ancestryLayerDataSource"> <!-- Dynamic Workspace (follow the link in the sample description for more information on dynamic workspaces --> <!-- table name and workspace id from census map service dynamic workspaces configuration --> <esri:TableDataSource dataSourceName="ancestry" workspaceId="CensusFileGDBWorkspaceID"/> </esri:LayerDataSource> </esri:rightTableSource> </esri:JoinDataSource> </esri:LayerDataSource> </esri:DynamicLayerInfo> </esri:dynamicLayerInfos> <esri:layerInfoWindowRenderers> <esri:LayerInfoWindowRenderer layerId="3" > <esri:infoWindowRenderer > <fx:Component> <esri:LabelDataRenderer label=" Details"> <s:VGroup paddingBottom="5" paddingLeft="5" paddingRight="5" paddingTop="5"> <fx:Script> <![CDATA[ import mx.utils.ObjectUtil; ]]> </fx:Script> <s:Label text="ID: { data.ancestry.State}"/> <s:Label text="Name: {data.states.ASIAN }"/> <s:Label text = "data: {ObjectUtil.toString(data)}"/> <!--<s:Label text = "data: {String(ObjectUtil.getClassInfo(data).properties)}"/>--> </s:VGroup> </esri:LabelDataRenderer> </fx:Component> </esri:infoWindowRenderer> </esri:LayerInfoWindowRenderer> </esri:layerInfoWindowRenderers> </esri:ArcGISDynamicMapServiceLayer> </esri:Map> </s:Application>
... View more
03-07-2013
09:17 AM
|
0
|
0
|
376
|
POST
|
I've tried the following options, none of them works sdegdb.editor.User1362628252032.newtam6 sdegdb.editor.User1362628252032.max_p_ch14nou1990 max_p_ch14nou1990 User1362628252032.max_p_ch14nou1990 Is there any combination that I missed? Thanks Xiaowen
... View more
03-06-2013
06:09 PM
|
0
|
0
|
376
|
POST
|
Hi Anthony, Thank you for your reply. Here's my set up My spatial table is http://23.21.106.101:6080/arcgis/rest/services/AdminBoundary/MapServer This table is linked to another table by code, the join relationship is very similar to below {"source": { "dataSource": { "workspaceId": "MyPostgreSQL", "dataSourceName": "user1362603115943", "type": "table" }, "type": "dataLayer" }} So, I can add a layer like (http://23.21.106.101:6080/arcgis/rest/services/AdminBoundary/MapServer/dynamicLayer?layer=%7B%22source%22%3A+%7B%0D%0A+%22dataSource%22%3A+%7B%0D%0A++%22workspaceId%22%3A+%22MyPostgreSQL%22%2C%0D%0A++%22dataSourceName%22%3A+%22user1362603115943%22%2C%0D%0A++%22type%22%3A+%22table%22%0D%0A+%7D%2C%0D%0A+%22type%22%3A+%22dataLayer%22%0D%0A%7D%7D+&f=html) into my application by program. Then I want to add popup info for this new created layer by the mudal below. However, even though this code works for other regular(no dynamic join layer), I can not make it work for this dynamic layer with dynamic join. private function configurePopUp(indicator:Object, layerID:Number):void{ /**showing the pop up info for indicator layer*/ var popUpInfo:PopUpInfo = new PopUpInfo(); var pFieldInfos:Array = []; var pFieldInfo:PopUpFieldInfo = new PopUpFieldInfo(); //pFieldInfo.fieldName ="sdegdb." + String(indicator.viewName).toLowerCase()+ "." + indicator.fldName; //pFieldInfo.fieldName = "newtam6"; //pFieldInfo.fieldName = String( indicator.viewName).substr(7, (String( indicator.viewName).length-7)) + "." + indicator.fldName; pFieldInfo.fieldName = "newtam6"; pFieldInfos.push(pFieldInfo); popUpInfo.title = indicator.indicatorStr; popUpInfo.popUpFieldInfos = pFieldInfos; //popUpInfo.description = "indicator is {sdegdb." + indicator.viewName+ "." + indicator.fldName+ "}"; Alert.show("indicator is" + pFieldInfo.fieldName + " " + layerID.toString()); var popUpRenderer:ClassFactory = new ClassFactory(PopUpRenderer); popUpRenderer.properties = {popUpInfo: popUpInfo }; var layerInfoWindowRenderer:LayerInfoWindowRenderer= new LayerInfoWindowRenderer(); layerInfoWindowRenderer.layerId = layerID; var infoWindowRenderer:ClassFactory = new ClassFactory(PopUpRenderer); infoWindowRenderer.properties = { popUpInfo: popUpInfo }; var arrLayerInfoWindowRenderer:Array = []; arrLayerInfoWindowRenderer.push(popUpRenderer); InDynMapLyr.layerInfoWindowRenderers = arrLayerInfoWindowRenderer; } Thank you for your help!
... View more
03-06-2013
12:23 PM
|
0
|
0
|
376
|
POST
|
I've added a layer with dynamic join -- very similiar to (http://resources.arcgis.com/en/help/flex-api/samples/index.html#/DynamicLayerInfo_JoinDataSource/01nq00000088000000/). However, when I try to use PopUpInfo to show the field value, even though I tried different combination of layername.fieldname or fieldname, I still got no luck. Can anyone guide me this? Thank you in advance. Xiaowen
... View more
03-04-2013
12:42 PM
|
0
|
7
|
3038
|
POST
|
I am trying to add a dynamic service layer, join the layer with table from a Postgre SQL database(the connection has been saved in dynamic work space). However, if I comment out the join function, the layer can be added successfully. When the join function is addedin, the layer disappears. Can anyone help me on this? Thank you so much. Below is the code. protected function CreateDynamiclayer(event:MouseEvent):void { var InDynMapLyr: ArcGISDynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer(); InDynMapLyr.url = "http://????:6080/arcgis/rest/services/Changwat/MapServer"; InDynMapLyr.dynamicLayerInfos = dynLyrInfos; map.addLayer(InDynMapLyr); var sWorkspaceID:String = "postgresql"; var sTablename:String = "PROV03To09INDEX"; var sJoinFieldname:String = "Prov_ID"; var SpatialKey:String = "NewProv2"; JoinDynamicLayer (sWorkspaceID,sTablename,sJoinFieldname, InDynMapLyr, SpatialKey); } private function JoinDynamicLayer(sWorkspaceID:String, sTablename:String,sJoinFieldname:String,dyn:ArcGISDynamicMapServiceLayer, SpatialKey:String ):void { //var dli:DynamicLayerInfo=dyn.dynamicLayerInfos[0] as DynamicLayerInfo; var dynamicLayerInfosArr:Array; dynamicLayerInfosArr = dyn.createDynamicLayerInfosFromLayerInfos(); var dli:DynamicLayerInfo = DynamicLayerInfo(dynamicLayerInfosArr[0]); //var dli:DynamicLayerInfo = dynLyrInfos[ 0 ]; var preexistingLyrSrc:ILayerSource = dli.source; var joinSrc:JoinDataSource = new JoinDataSource(); joinSrc.joinType = JoinDataSource.LEFT_OUTER_JOIN; joinSrc.leftTableSource = preexistingLyrSrc; joinSrc.leftTableKey = SpatialKey; var newTblSrc:TableDataSource = new TableDataSource(); newTblSrc.workspaceId = sWorkspaceID; newTblSrc.dataSourceName = sTablename; var newTblLyrSrc:LayerDataSource = new LayerDataSource(); newTblLyrSrc.dataSource = newTblSrc; joinSrc.rightTableSource = newTblLyrSrc; joinSrc.rightTableKey = sJoinFieldname; var newDynLyrSrc:LayerDataSource = new LayerDataSource(); newDynLyrSrc.dataSource = joinSrc; dli.source = newDynLyrSrc; dynLyrInfos = [ dli ]; Alert.show ("joined dynamic layer"); //dyn.dynamicLayerInfos = [dli]; //dynLyrInfos = [ dli ]; } <fx:Declarations> <fx:Array id="dynLyrInfos"> <esri:DynamicLayerInfo defaultVisibility="true" layerId="0"> <esri:LayerMapSource mapLayerId="0"/> </esri:DynamicLayerInfo> </fx:Array> </fx:Declarations>
... View more
09-19-2012
08:18 AM
|
0
|
0
|
1665
|
POST
|
I've created an EC2 Instance by ArcGIS 10.1 server for windows with SQL Server. However, after I log in, I can not find the sample world city service. Meanwhile, other than the system databses, I don't have geodata and egdb geodatabases . In security, there's a ssa login, but no sde login is found. Can anyone helped me out? Xiaowen
... View more
08-30-2012
12:22 PM
|
0
|
1
|
778
|
POST
|
I need run a script which basically zooms to every polygon by loop in the picked feature layer and ask the user to input a value and write the value back to the feature class. However, I can not get the raw_input window work, can anyone help me? Below is the code. Thank you very much for your help in advance. import arcpy, sys, os from arcpy import env try: #get the current doc mapDoc = arcpy.mapping.MapDocument("CURRENT") #get the data frame df = arcpy.mapping.ListDataFrames(mapDoc)[0] lyr = arcpy.mapping.ListLayers(mapDoc, "BG2008Permeability", df)[0] thePath = lyr.dataSource print thePath cur = arcpy.UpdateCursor(thePath) if cur: print "get the cursor" for row in cur: newExtent = row.Shape.extent # or geom.extent df.extent = newExtent print "get the extent" thePattern = raw_input("\nwhich street pattern?\n") #strPattern = tkMessageBox.askquestion("which street pattern?" message = "0") #print strPattern row.StrPattern = thePattern cur.updateRow(row) del cur, row except: if not arcpy.GetMessages() == "": arcpy.AddMessage(arcpy.GetMessages(2)) finally if cur: del cur if row: del row
... View more
10-26-2010
09:24 AM
|
0
|
1
|
776
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|