|
POST
|
I recently tried updating an app to allow adding selections to a FeatureLayer. This is using the 2.4 Flex API (want to avoid updating for the moment). I'm not doing any editing, I'm just loading the FeatureLayer with a service url like so http://internalserver/ArcGIS/rest/services/SewerFeatures/MapServer/4 I create my FeatureLayer like so
fLayer.mode = FeatureLayer.MODE_SELECTION
This thread suggests that I should use FeatureLayer.SELECTION_ADD when initializing, but when I did that, no selections worked. Anyway, I can do a selection using the default "new"
fLayer.selectFeatures( query, FeatureLayer.SELECTION_NEW, new AsyncResponder( onSewerFeaturesSelected, onFault ));
Then when I try to add to this selection at some point after the results are shown
fLayer.selectFeatures( query, FeatureLayer.SELECTION_ADD, new AsyncResponder( onSewerFeaturesSelected, onFault ));
It doesn't add new features to the selection, it just does a new selection and clears what was previously selected. These queries are being done via a geometry if that matters. Maybe I'm misunderstanding what FeatureLayer.SELECTION_ADD does when in FeatureLayer.MODE_SELECTION. I can probably work around it by saving my selected graphics and adding them back, but I would think the above method should work.
... View more
03-13-2012
02:43 PM
|
0
|
1
|
3274
|
|
POST
|
Odd. I just tried the link you posted and get the same thing in IE Version 8.0.6001.18702 Works fine in Chrome. I haven't looked at the Flex samples pages in ages, never noticed it before.
... View more
01-26-2012
04:59 AM
|
0
|
0
|
672
|
|
POST
|
Nice catch. It wasn't THE fix, but it got me to figure out a workaround. I still have an issue where wo_FeatureLayer is null, but I can get around it like this.
FeatureLayer fl = Map.Layers.Where(lyr => lyr.ID == "WorkOrders").First() as FeatureLayer;
I'm still new to Silverlight, so maybe accessing MainPage.xml items is a little different. But thanks, that helped!
... View more
01-21-2012
01:33 PM
|
0
|
0
|
659
|
|
POST
|
Please excuse my noobness when it comes to Silverlight, I'm still learning it. I am currently trying to select an item in my FeatureLayer based on a row click of a DataGrid. I found this thread, which I thought would get me on the right track, and I think I'm half way there. http://forums.arcgis.com/threads/19265-Selection-Based-on-Attributes?highlight=featurelayer+selection
<esri:FeatureLayer ID="WorkOrders" x:Name="wo_FeatureLayer" Url="http://servername/ArcGIS/rest/services/WorkOrders/MapServer/0"
OutFields="*">
</esri:FeatureLayer>
Then I have a DataGrid with some data where a single field matches an ID in my FeatureLayer. I use the DataGrids SelectionChanged event to start my query.
private void wo_DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
try
{
WORK_ORDER wo = e.AddedItems[0] as WORK_ORDER;
MessageBox.Show(wo.WorkOrderID.ToString());
// when I step through on a breakpoint here, it always tells me wo_FeatureLayer is null
var graphic = wo_FeatureLayer.Where(g => g.Attributes["MXWONUM"].ToString() == wo.WorkOrderID.ToString()).First();
graphic.Select();
}
catch(Exception err)
{
MessageBox.Show("oops:" + err.Message);
}
}
The resulting error is, "Value cannot be null. Parameter name:source" I know the FeatureLayer works, because I use it's MouseLeftDown event to populate another window without issue. I'm sure I must be missing something simple, but a nudge in the right direction would be helpful. Thanks.
... View more
01-21-2012
10:07 AM
|
0
|
3
|
947
|
|
POST
|
I just have to say, it's real nice to see flexviewer source on github. Makes things simpler.
... View more
12-04-2011
10:43 AM
|
0
|
0
|
822
|
|
POST
|
Dasa chimed in over here http://forums.arcgis.com/threads/43859-Adobe-donating-Flex-to-open-source-community It's basically going from Adobe Flex to Apache Flex.
... View more
11-18-2011
06:20 AM
|
0
|
0
|
1285
|
|
POST
|
Can you use the flash debugger to verify that Geolocation.isSupported==true on your device?
... View more
11-17-2011
06:27 AM
|
0
|
0
|
1899
|
|
POST
|
It will most likely end up in the hands of the Spoon Project. http://www.spoon.as/ They are a solid group of very good talented, experienced flash and flex developers that have already been working on an open source fork of the Flex framework. They are eager to take it on. I don't know if this will impact the ESRI Flex API roadmap. Should make for some interesting discussion at dev summit next year. My interest in Flex development has been waning this year and that is reflected in the direction I have been taking development of upcoming projects in my agency. I would very much like to see Flex thrive as a fully open-sourced project though. Afterall, Flex is how you build AIR apps, and AIR is very much a viable solution for mobile development. So correction. Looks like Flex will go to the Apache foundation and incorporating Spoon contributions. http://blogs.adobe.com/flex/2011/11/your-questions-about-flex.html
... View more
11-15-2011
01:39 PM
|
0
|
0
|
554
|
|
POST
|
Ok, this seems to work in all situations I have tried it in to remove the glow filter.
private function removeGlow(fl:FeatureLayer):void
{
var len:int = fl.numChildren;
var dObj:DisplayObject;
for ( var i:int = 0; i < len; i++ ) {
dObj = fl.getChildAt(i);
if (dObj.filters) {
dObj.filters = [];
}
}
}
It has slightly helped with performance, so I'll squeeze as much as I can out of it.
... View more
10-19-2011
09:26 AM
|
0
|
0
|
326
|
|
POST
|
I don't see this as an option in the API docs, so I was trying to extend FeatureLayer and override updateLayers() or something to try and remove the GlowFilter, but can't figure it out. I need to optimize selecting thousands of points and lines, and I think the added GlowFilter is adding my overhead. Clustering isn't an option for the data type being represented. Any tips? I could go back to using a GraphicLayer, but I'd need to do a lot of rewrites to replicate the relationship queries I am doing.
... View more
10-19-2011
08:42 AM
|
0
|
1
|
548
|
|
POST
|
You can access the Shape.len field, but you'll need to use bracket notation since the "." won't translate over in code. I tested this and it works with my SDE data.
var query:Query = new Query();
query.outFields = ["*"];
query.returnGeometry = false;
query.where = "AssetID <> ' '";
var queryTask:QueryTask = new QueryTask("http://testgis/ArcGIS/rest/services/SewerSystemTest/MapServer/5");
queryTask.execute(query, new mx.rpc.Responder(function(features:FeatureSet):void {
for each(var o:Object in features.attributes)
{
trace(o["Shape.len"]);
}
}, function(fault:FaultEvent):void{ trace("error", fault.message); }));
... View more
10-03-2011
12:12 PM
|
0
|
0
|
858
|
|
POST
|
It will support plugins in desktop mode, just not browser mode. So no different than current iPads that do not support Flash.
... View more
09-16-2011
12:54 PM
|
0
|
0
|
567
|
|
POST
|
Nevermind. I found it. It's an Enum in FileGDBCore.h
enum FieldType
{
fieldTypeSmallInteger = 0,
fieldTypeInteger = 1,
fieldTypeSingle = 2,
fieldTypeDouble = 3,
fieldTypeString = 4,
fieldTypeDate = 5,
fieldTypeOID = 6,
fieldTypeGeometry = 7,
fieldTypeBlob = 8,
fieldTypeRaster = 9,
fieldTypeGUID = 10,
fieldTypeGlobalID = 11,
fieldTypeXML = 12,
};
Noob mistake.
... View more
08-31-2011
07:00 PM
|
0
|
0
|
611
|
|
POST
|
Maybe I'm looking at this wrong, but I have looked over the docs and can't find any further info on FieldType, except that it's a parameter to FieldInfo::GetFieldType().
FieldInfo fInfo;
table.GetFieldInformation(fInfo);
int count = 0;
fInfo.GetFieldCount(count);
wstring fieldNames = L"";
for (int x = 0; x < count; x++)
{
wstring f = L"";
fInfo.GetFieldName(x, f);
fieldNames.append(f);
FieldType fType;
fInfo.GetFieldType(x, fType);
fieldNames.append(L", ");
}
Basically, what I'm trying to do is get the names of each field and the field type. When I test something like this out in a sample app, I can do
wcout << fType << endl;
I get an integer, which I am guessing coincides with an something like esriIntegerType, but are there methods to FieldType, like toString() or something to get that? I'm new to C++ and I'm just a little confused on how to use this. Thanks.
... View more
08-31-2011
06:36 PM
|
0
|
1
|
2995
|
|
POST
|
The loader itself is not the actual source, the loader will go outside your app and grab your data for you. You'll want to add an event listener to the contentLoaderInfo of the loader so that when the data is returned and ready, then you can use it as a source for the PictureMarkerSymbol. So something like this
loadThumbnail.contentLoaderInfo.addEventListener(Event.COMPLETE,
function(e:Event):void {
thisGraphic.symbol=new PictureMarkerSymbol(e.currentTarget.content);
});
I haven't tried this approach to load a PictureMarkerSymbol, but I think it would work.
... View more
08-11-2011
05:47 AM
|
0
|
0
|
479
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | Tuesday | |
| 1 | 4 weeks ago | |
| 2 | a month ago | |
| 1 | 02-27-2026 06:31 AM | |
| 1 | 01-13-2026 02:15 PM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|