POST
|
Thanks for the tip Rhett. I actually got rid of the white background on the Dynamic Legend widget since I was using the sandy color theme which is a light BG already. The background I had looked better than a white box to me. I totally understand the contrast benefit of a white box, but I pretty much had that with the background color I was using.
... View more
07-30-2013
09:53 AM
|
0
|
0
|
273
|
POST
|
I solved this by upgrading my source code from 3.2 to 3.4 and using the out of the box Legend widget. I went to the Dynamic Legend widget because the 3.2 OOB Legend widget wasn't updating when layers were turned on and off, or when graphics layers were added by my widgets. Today I rebuilt my viewer with a fresh download of 3.4 source and the OOB Legend works as expected now and is itself dynamic. And it nicely matches the Map Switcher ordering which is what I wanted from Dynamic Legend when I asked this question. Thanks, Aaron
... View more
07-30-2013
08:24 AM
|
0
|
0
|
273
|
POST
|
This is regarding Robert Scheitlin's Dynamic Legend widget located here. I am using the 3.2 uncompiled version. My operational layers seem to be displaying in no particular order in the widget. I'm sure it's based on something, but right now it seems quite random. Can anyone explain the logic behind the sorting of items in the Dynamic Legend widget, and how/where I might go about changing or controlling it? I'd really like to have them in the order they are listed in the Map Switcher widget. Thanks, Aaron
... View more
07-26-2013
07:48 AM
|
0
|
3
|
1823
|
POST
|
Has anyone load tested an ArcGIS Viewer for Flex based application? If so, how did you do it? Thanks, Aaron
... View more
07-08-2013
06:09 AM
|
0
|
0
|
354
|
POST
|
I used this sample which is buried in What's New for the API making it, in my opinion, hard to find, but Google found it when I asked for "esri:infoWindowRenderer popup": http://resources.arcgis.com/en/help/flex-api/samples/index.html#/Display_popups_programmatically/01nq0000008v000000/ This sample showed me how to build and assign PopUpRenderer as the infoWindowRenderer for my widget's graphics layer. I had been building an infoWindowRenderer for each individual graphic coming back from the query response using a VBox, but that didn't assign a popup to the cluster symbols. By applying it to the layer, it appears to attach to any graphics including the cluster symbols. While I was implementing this, I learned to read in specific values from the config file and loop accordingly, so the popup title and fields are now configurable from the widget's config file. This really helped me get a handle on how to use the config file in a loop. This is my init function. You can compare it to the sample above to see how it differs. The main difference is the loop for the PopUpFieldInfo items in the config and getting the title from config instead of explicitly building them in the init. // this function called when the widget's configuration is loaded private function init():void { // build the layer to hold the graphics graphicsLayer = new GraphicsLayer(); graphicsLayer.visible = false; graphicsLayer.renderer = new SimpleRenderer(mySymbol); graphicsLayer.clusterer = clusterer; map.addLayer(graphicsLayer); // get pop-up fields from the config file xmlPopupFields = configXML.popup.fields.field; xmlPopupTitle = configXML.popup.title; // array to hold popup fields for assignment to popUpFieldInfos var popupFields:Array = []; // Create the pop-up field infos from each field in the config XML for each (var field:Object in xmlPopupFields) { var popupFieldInfo:PopUpFieldInfo = new PopUpFieldInfo(); popupFieldInfo.fieldName = field.name; popupFieldInfo.label = field.alias; popupFieldInfo.visible = true; popupFields.push(popupFieldInfo); } // Create the pop-up info var popUpInfo:PopUpInfo = new PopUpInfo(); // Tell the pop-up info about the field name template popUpInfo.title = "{" + xmlPopupTitle + "}"; popUpInfo.popUpFieldInfos = popupFields; // Create the class factory var popUpRenderer:ClassFactory = new ClassFactory(PopUpRenderer); // Set the "popUpInfo" key popUpRenderer.properties = { "popUpInfo": popUpInfo }; // Set the info window renderer to use the pop-up renderer graphicsLayer.infoWindowRenderer = popUpRenderer; // get counties starts the init chain of events getCounties(); } Hopefully this will help somebody else who is trying to do something similar. Aaron
... View more
06-11-2013
05:08 AM
|
0
|
0
|
163
|
POST
|
How do I use esri:WeightedClusterer to cluster graphics and get a popup like the image below (which is from an operational layer in the flex viewer)? In my app, I don't get any popups for the cluster symbols, only for the flares. [ATTACH=CONFIG]25032[/ATTACH] Thanks, Aaron
... View more
06-05-2013
11:57 AM
|
0
|
1
|
508
|
POST
|
Can anybody explain how to do this since both of the links above are dead? I am using 3.2. Is it still supported in 3.2? I downloaded the 3.0 API zip to look for the mentioned sample, but the clustering mxml doesn't seem to be doing anything to keep the flares out. Thanks, Aaron
... View more
06-03-2013
10:33 AM
|
0
|
0
|
337
|
POST
|
Thanks so much Robert! That is a great document. I am lost as to why my plethora of searches on the subject here did not yield that thread. Thanks again all.
... View more
05-06-2013
05:44 AM
|
0
|
0
|
275
|
POST
|
Thanks so much Kenny. This is what I needed to hear. I had seen a lot of posts about sharing data with DataManager, but this made it click after careful consideration of your explanation. I may post some basic code here later to help others who need help trying to "visualize" it.
... View more
05-03-2013
11:45 AM
|
0
|
0
|
275
|
POST
|
I solved this by making a modified version of this progress bar widget. Mine uses the mobilecomponents.swc BusyIndicator as an indefinite busy indicator. In registerHandlers I attached a listener to the cluster layer's UPDATE_END event.
... View more
05-02-2013
11:12 AM
|
0
|
0
|
165
|
POST
|
I have 2 widgets that need to share an arraycollection. I want to create the collection once in which ever widget initializes first, and then store it for them both to use from that point forward. I've looked at DataManager and I can see how I would share data in an event driven way. What I don't see is a way to store data in DataManager when either widget initializes and 1) check for the data's existence when the second widget loads so I don't have to create it again, and 2) how I would retrieve the stored data in the second widget if I could check for its existence in DataManager. For reference, the driving force here is that I have comboboxes in each widget that need to use the same data. Can anyone explain how I would share a single collection of data between widgets that only gets initialized once? Any help would be greatly appreciated. Thanks, Aaron
... View more
05-01-2013
12:51 PM
|
0
|
5
|
752
|
POST
|
I'm clustering 20k+ points over a basemap. This causes the browser/player to hang with a blank base map for several seconds while it does the math, I guess. Then I get a nice set of clustered graphics on the map with no latency thereafter. This is of course driving me, and my boss, insane due to the 10+ second wait. So I've used mobilecomponents.swc to thrown up a BusyIndicator which I would like to turn off when clustering completes. Does any one know if there is a way to listen to clustering? I did not see any relevant events in the API ref, but I am new to this. I also tried adding a preloader, but it completes before any of this latency begins, and actually makes the overall spinup time increase. It's probably worth mentioning that this is in a Flash Builder project with the 3.2 flex viewer source. The only mod to the source is adding the following code to index.mxml. I plan to make it prettier than this if I can find a way to turn it off after the clusters are visible. I also built a custom query widget, but it is not loaded when this latency occurs.
</viewer:ViewerContainer>
<s:BusyIndicator id="busyIndicator"
symbolColor="red"
visible="true"
width="200"
height="200" />
Any help or guidance would be greatly appreciated. Thanks, Aaron
... View more
04-30-2013
09:32 AM
|
0
|
1
|
540
|
POST
|
Thanks so much Robert! That got it. Indeed you are powerful... ~Vader Now I have a ComboBox of feature layer geometries that is populated from a querytask. Thanks again, Aaron
... View more
04-25-2013
06:13 AM
|
0
|
0
|
187
|
POST
|
I would like to have a combobox use a graphic's geometry as it's value. I don't know if this is even possible, and I can't find anything definitive on the subject. I'm hoping some of the geniuses here can shed some light on the subject. Right now I have a combobox that I have populated from an array collection built by a querytask response. Technically it is 4 querytask responses in array collections that are merged into a single array collection when all the tokens light up true. Then this single array collection is assigned as the dataprovider for the combobox. I'm setting up the collection in this manner: collection.addItem({label:fieldValue, data:graphic.geometry}) // where field value is a string and then assigning it like this after concatenating the collections: cmb1.labelField = "label"; cmb1.dataProvider = mergedCollection; // where mergedCollection is a concatenation of collections as created above The problem is that when I then select an item from the seemingly populated combobox and submit the query I get the following: [RPC Fault faultString="Unable to complete operation." faultCode="400" faultDetail="'where' parameter not specified 'objectIds' parameter not specified 'time' parameter not specified 'geometry' parameter not specified 'text' parameter not specified Unable to complete Query operation."] Here is a sample of my code. The whole process of populating the combobox starts in initCombo(). Hopefully you can follow it from there. I also included doQuery() which is called from a button after the user picks something from the combobox.
private function initCombo():void
{
var baseURL:String = "http://myserver/ArcGIS/rest/services/mystuff/MapServer/"
var tokenCounter:int = 0;
// tokens is an array collection of objects
// only feature layers 7 to 10 are relevant for this combobox
for (var i:int = 7; i < 11; i++) {
queryTask.url = baseURL + i.toString();
queryTask.execute(query, new AsyncResponder(onResult, onFault, tokens.getItemAt(tokenCounter)));
tokenCounter++;
}
function onResult(featureSet:FeatureSet, token:Object = null):void
{
for each (var graphic:Graphic in featureSet.features)
{
var fieldValue:String = token.name + " " + graphic.attributes["OBJECTID_1"].toString();
token.collection.addItem({label:fieldValue, data:graphic.geometry});
}
for each (var item:Object in tokens)
{
// probably a better way to get a handle back to global collections than this
if (item.name == token.name)
{
item.collection = token.collection;
item.completed = true;
break;
}
}
// if all the tokens are true, merge the collections into one
if (checkTokens()){
// collections is an array containing the array collections so I can iterate through them
for (var i:int = 0; i < collections.length; i++)
{
mergedCollection = new ArrayCollection(result.source.concat(collections.source));
}
cmb1.labelField = "label";
cmb1.dataProvider = mergedCollection;
}
}
function onFault(info:Object, token:Object = null):void
{
Alert.show(info.toString(), "Query Problem");
}
}
private function checkTokens():Boolean
{
for (var i:int = 0; i < tokens.length; i++)
{
if (!(tokens.completed))
{
return false;
}
}
return true;
}
private function doQuery():void
{
graphicsLayer.clear();
query.where = "";
// I thought this would be the geometry returned by the query
query.geometry = cmb1.selectedItem.value;
queryTask.execute(query, new AsyncResponder(onResult, onFault));
function onResult(featureSet:FeatureSet, token:Object = null):void
{
var graphicsExtent:Extent = GraphicUtil.getGraphicsExtent(featureSet.features);
if (graphicsExtent)
{
map.extent = graphicsExtent;
}
graphicsLayer.graphicProvider = featureSet.features;
}
function onFault(info:Object, token:Object = null):void
{
Alert.show(info.toString(), "Query Problem");
}
}
This is the MXML for my combobox: <s:ComboBox id="cmb1" x="179" y="205" labelField=""/> Any help would be greatly appreciated. Thanks, Aaron
... View more
04-24-2013
01:27 PM
|
0
|
2
|
553
|
POST
|
I've been able to use the API in a new flex 4 project in FlashDevelop 4.3.0 to build a the basic World Topo map example, but I can't figure out how to get the ArcGIs Viewer for Flex source code to work in FlashDevelop so I can build a custom widget. Is anybody out there using FlashDevelop? Thanks, Aaron
... View more
04-15-2013
01:03 PM
|
0
|
0
|
456
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|