|
POST
|
I am building a custom class for a datagrid based on the outFields specified in a featurelayer. I want to add listeners for the change event on the map and only populate the grid with the features in the current map extent. The datagrid comes up in a TitleWindow. This works fine for the initial load. If I'm zoomed in, only those features in the extent are loaded into the grid. When I pan/zoom, the extent change handler, onExtentChange runs. A new arrayCollection is created based on what is in the current map extent and defined as the new dataprovider to the grid. This arrayCollection has the right elements in it. I can't get the datagrid to use this new AC as the dataprovider! I've tried defining the ArrayCollection at the start and I've tried creating a new one within the function. I'm not sure that makes any difference, but I'm trying all sorts of things at this point. I've tried refreshing the arraycollection. I've tried invalidateList. I've tried firing a dispatchevent on the collection change of the arraycollection. Nothing changes the display. I'm not sure what else to even try! When I search the forums, all I find are the last questions I've posted myself on syncing datagrid to map extents. I guess not many people are trying to do this?! I
... View more
12-05-2011
10:33 AM
|
0
|
0
|
716
|
|
POST
|
The PopUp does just that. It pops up when the user clicks on a feature. So if you were wanting to generate labels as you might through the Desktop, you would need to approach it differently. Tracy
... View more
11-02-2011
05:10 AM
|
0
|
0
|
679
|
|
POST
|
I have been using a PopUpRenderer for labeling my featurelayers. I have the fields I want in an array. Then I populating the popup with the fields from it. Here is the section of code where that is happening: featureLayer.outFields = outFields.split(",");
var pFieldsArray:Array = new Array();
var popUpInfo:PopUpInfo = new PopUpInfo;
for (var j:Number = 0; j < featureLayer.outFields.length; j++) {
var pFieldInfo:PopUpFieldInfo
pFieldInfo = new PopUpFieldInfo();
pFieldInfo.fieldName = featureLayer.outFields ;
pFieldInfo.label = featureLayer.outFields + ": ";
pFieldInfo.visible=true;
pFieldInfo.format = new PopUpFieldFormat();
pFieldsArray.push(pFieldInfo);
}
popUpInfo.popUpFieldInfos = pFieldsArray;
var popUpRenderer:ClassFactory = new ClassFactory(PopUpRenderer);
popUpRenderer.properties = {popUpInfo:popUpInfo};
featureLayer.infoWindowRenderer = popUpRenderer ;
... View more
11-01-2011
10:24 AM
|
0
|
0
|
679
|
|
POST
|
I know this is an older post. Did you ever get this to work?
... View more
10-04-2011
01:30 PM
|
0
|
0
|
289
|
|
POST
|
I'm getting a little lost with the parameters sent with the gettoken request. What exactly is clientID? The application that is calling the service? Several examples I've seen have had the url and the clientID the same. If my services and my application are on the same machine, is that when I would set both of these the same? When I generate tokens through the services directory, it only worked for me when I chose the IP as the Identifier (as opposed to the Web Application URL or HTTP Referrer). I could then paste that token hard coded into FLEX and it draws the layer I want. I can generate a token using: http://www.myGISserver.gov/arcgis/tokens?request=gettoken&username=schlot&password=password&expiration=15&ip=100.10.10.100 and I can do something similar programmatically through an HTTP Service call. However, only the token created ArcGIS Token Services page that comes with AGS Service Manager works. There is a token created with the the "request=gettoken" URL, which doesn't work. I have a similar problem requesting the token programmtically. I get one returned, but it doesn't work then either. Here's the dumb question: where do you specify which service you want the token on? Should I be more specific in the URL path? It seems like I ought to be able to use either type of Identifier and have it work, and I'm confused why one works and other doesn't.
... View more
05-24-2011
11:27 AM
|
0
|
0
|
1132
|
|
POST
|
I have been using a set of functions to run query tasks for a long time. I now need to run the same query tasks against a secure service. I thought it would be a matter of adding the token parameters to the querytask, something like: var coQryTask:QueryTask = new QueryTask (); var tokenString:String = "szd;flksdjfaweporjiwerpoiwjer"; coQryTask.url="http:myserver/arcgis/rest/services/SecureServices/mySecureLayer/MapServer/0; coQryTask.token = tokenString; coQryTask.showBusyCursor = true; coQuery.geometry = mainMap.extent; coQryTask.execute(coQuery, new AsyncResponder( coResult, onFault )); coQuery is defined elsewhere as: <esri:Query id="coQuery" where="1=1" returnGeometry="true" outFields="[ 'NAME', 'RATE' , 'INCIDENTS' , 'POPULATION' ]" outSpatialReference="{mainMap.spatialReference}" /> My result function does not return anything in the feature set: public function coResult( qryFeatureSet:FeatureSet, token:Object = null ) : void for each (var myGraphic:Graphic in qryFeatureSet.features) { myGraphic.toolTip = myGraphic.attributes.NAME2 + "\n" + "Total Population: " + myGraphic.attributes.POPULATION + "\n" + "Incidents: " + myGraphic.attributes.INCIDENTS + "\n" + "Rate: " + myGraphic.attributes.RATE + "\n"; coGraphicsLayer.add( myGraphic ); } } I've been assuming the token:Object = null part of the function is something that goes with an asynchronous request and is NOT the token string that I was issued by the token service. This code has worked just fine for me against a standard service, I just can't get it to work with the secure service. If I hard code everything with my querytask and query it does run, but I need to get this to work in ActionScript.
... View more
05-18-2011
10:13 AM
|
0
|
0
|
587
|
|
POST
|
Found it! I had changed the wkid of my map, but forgot to change the extent coordinates. I've gotten tripped up more times over those two things! Thanks Robert. Now I'm going to be brave and see if I can continue on with some of your non-FV search window code.
... View more
02-14-2011
07:25 AM
|
0
|
0
|
859
|
|
POST
|
I did notice you have changed the wkid on the one layer that was getting drawn outside the config file. (I tried the one you had first before I changed to the one I'm using.) I'm puzzled why this code works for you and not for me. Did you change anything in the config.xml? I assumed not since you only posted code changes. I'm off to our state GIS conference for the next couple of days. I think there will be a few FLEX gurus there; maybe I can get some additional input.
... View more
02-14-2011
06:44 AM
|
0
|
0
|
859
|
|
POST
|
Now nothing at all seems to be drawing. I'm also unclear when I should be nesting a function within another one. Looking at my trace statements, it doesn't look like the onResult function gets called under after it loops through both of my entries in my function for the HTTPService call. I would expect that the first entry in the config file would set the variables, then run the query task with the appropriate parameters and then go back to the HttpService function, set new parameters from the next entry and go all the way through again. That isn't what's happening. I'm wondering if I need to be firing off a dispatchEvent instead of just relying on the listeners.
... View more
02-14-2011
06:29 AM
|
0
|
0
|
859
|
|
POST
|
Thanks Robert. I figured once I got past where this was stuck, I could look back into the code you'd written for the non-FV search window. I think the components for recordData etc will likely apply. I won't have a chance to do much with this the next few days, but I'll pick it up again later on next week.
... View more
02-10-2011
12:47 PM
|
0
|
0
|
859
|
|
POST
|
I'm interested in this as well. I've gotten pretty far along with some code. I'm not sure if anyone even looks at threads that are older than a few days, but I'll give this a shot rather than starting another thread. This code reads the external config file, but I'm getting lost in the looping in a few places: The querytask seems to be executing only after it's looped through both of the entries in the config.xml The symbol for the picturemarkersymbol gets used twice. The field name I'm using for the tooltip isn't getting read properly yet. It does seem to be loading both layers from the config file though! You'll need to have a few of your own images, I'm not providing those. I see that Robert Scheitlin has posted something similar for the search widget, but I didn't see that he'd done one for the live layer. We got caught in that huge storm that hit so many states and it would have been nice to have this functionality separated out of the FlexViewer so I could have easily loaded different data into my own interface simply by updating my config file. I'm in the minority, but I'm not a big fan of the FlexViewer interface.
... View more
02-08-2011
12:43 PM
|
0
|
0
|
859
|
|
POST
|
I'm having a similar issue. The Postal_US locator can't be opened so I tried downloading this zip file. It's telling me it's password protected and wants to know the password? We're still on IE7.
... View more
01-13-2011
10:45 AM
|
0
|
0
|
954
|
|
POST
|
I'll leave myself a note. Who knows when my Flash will finally get here. How are you managing to develop in both versions? I assumed I couldn't have both installed. Is 4 so backwardly compatible that you can use old code and the older API? I assumed like many upgrades that there was no turning back.
... View more
12-29-2010
07:49 AM
|
0
|
0
|
1005
|
|
POST
|
Thanks so much! My FLEX 4 books came in today, so hopefully I'll be upgraded soon.:cool:
... View more
12-29-2010
07:31 AM
|
0
|
0
|
1005
|
|
POST
|
Yes, I'm still using the older versions. I don't dare download the evaluation copy of Flash Builder until I know the purchase has at least been approved. Right now it's a painful and slow process to buy anything. After messing with my code a bit more, I did have better luck using an Identify task for each of the points and then accumulating those results into an array to populate datagrid and chart. It's still really sloppy programming, but it is somewhat functional. I don't know what it is about posting something to the forum that often jogs something in my own mind. If you don't want to mess with the older code, I understand. I'm sure I will have lots more questions once I finally do make the switch! One thing you might be able to answer for me. I haven't used identifytask much, I've generally used querytask. The identify task seems to take a little longer and so some of the time I've clicked and the previous task hadn't quite complete (so it basically skipped over it). In the reference, it says you can set the concurrency on it, but if you set it to multiple you have to manage the event stream yourself. I was wondering what the code would look like for such a thing.
... View more
12-29-2010
04:38 AM
|
0
|
0
|
1005
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-02-2017 02:38 PM | |
| 2 | 03-18-2022 10:14 AM | |
| 2 | 02-18-2016 06:28 AM | |
| 1 | 03-18-2024 07:29 AM | |
| 4 | 08-02-2023 06:08 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-25-2025
01:56 PM
|