|
POST
|
You should wrap the collection in a dataprovider and use the fx namespace for object.
<s:ButtonBar>
<s:dataProvider>
<s:ArrayCollection>
<fx:Object />
</s:ArrayCollection>
</s:dataProvider>
</s:ButtonBar>
... View more
05-04-2011
08:44 AM
|
0
|
0
|
344
|
|
POST
|
FB 4.5 has an iOS packager, and I know you can deploy to an iOS device. I have not checked to see how the touchscreen capabilities work with the Flex API though. I would think that would be my main area of concern.
... View more
05-04-2011
07:57 AM
|
0
|
0
|
954
|
|
POST
|
You shouldn't need to do anything in your properties in FlashBuilder. Just delete the swc in the libs folder and add the new one. FlashBuilder by default will look for swc files in the {project}/libs folder. So, if you delete the folder in your "Flex Build Path" properties, go back to it, click on "Add SWC Folder", just type in libs (it will know to look in your project directory) and make sure you have the correct swc in the libs folder. If you added a swc manually in the properties area via the Add SWC..., delete it in the properties. This will get you back where you started.
... View more
04-26-2011
02:49 PM
|
0
|
0
|
268
|
|
POST
|
Ok, I should kick myself. this line... qf.SubFields = "AIN"; needs to change to qf.SubFields = "*"; Apparently, by explicitly defining the returned fields in the queryfilter, if you leave out Shape and OID, they will not be returned either. That's why IFeature.Shape failed, the Shape field was not included in my query. I just assumed Shape would be a default field regardless of what I specified. Ok, that was quite a learning experience. Thanks for looking.
... View more
04-21-2011
02:22 PM
|
0
|
0
|
775
|
|
POST
|
I don't usually need to deal with geometries too often in ArcObjects, but this is giving me quite a hard time. I can get a IFeature object from my SDE. I can access the attributes fields just fine and pass them as needed. The problem is, when I try to access the IFeature.Shape property, I get the following error. Error HRESULT E_FAIL has been returned from a call to a COM component. stacktrace at ESRI.ArcGIS.Geodatabase.IFeature.get_Shape() This is a code snippet below.
Type sde_type = Type.GetTypeFromProgID("esriDataSourcesGDB.SdeWorkspaceFactory");
//IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)new SdeWorkspaceFactoryClass();
IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(sde_type);
IWorkspace workSpace = workspaceFactory.Open(propertySet, 0);
IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)workSpace;
#endregion
IFeatureClass featureClass = featureWorkspace.OpenFeatureClass("sde.LA_Parcels");
// prepare the query filter
IQueryFilter qf = new QueryFilterClass();
qf.SubFields = "AIN";
qf.WhereClause = "AIN = '" + ain + "'";
IFeatureCursor fc = featureClass.Search(qf, true);
IFeature feat = fc.NextFeature();
string s_ain = "NOT FOUND";
if (feat != null)
{
int field = feat.Fields.FindField("AIN");
s_ain = feat.get_Value(field) as string;
// grab some more field data ...
IGeometry fgeom = null;
try
{
fgeom = feat.Shape; // error gets thrown here
}
catch (Exception e)
{
throw new Exception(String.Format("ParcelLocationData Geometry from Shape Error: {0}", e.Message), e);
}
}
I had read on a blog that it was good practice when creating ArcObjects objects on server to not use "new", but use Activator.CreateInstance, so I switched that up as it came up in my search on the COM error, but still nothing works. I can view this data in ArcMap just fine, it works on MapServices that we have. I have other C# dll's using ArcObjects running on this server just fine for sewer tracing, none of which actually access the IFeature.Shape property though. Is there a step I am missing to try and do this? My goal here is to use the IFeature.Shape as a basis for some spatial queries on other features. Something like this IArea area = (IArea)fgeom;
spatialFilter.Geometry = area.Centroid Thanks in advance, and I'm sorry if this is something simple I am missing.
... View more
04-21-2011
01:05 PM
|
0
|
2
|
1199
|
|
POST
|
Scratch this. I think it has to do with SVN failing to delete 2.2 from a library project. 2.2 refs still floating around. Can verify Monday. Thanks. My bad.
... View more
04-15-2011
02:50 PM
|
0
|
0
|
599
|
|
POST
|
Bjorn, the what's new states that InfoWindow has been moved from com.esri.ags.components.supportClasses. I think it now sits in com.esri.ags.components, is that correct? My InfoWindows seems to be all broken now when I use my own InfoWindowRender. Should I just make a new thread?
... View more
04-15-2011
12:24 PM
|
0
|
0
|
771
|
|
POST
|
In a situation like that, you'd probably want to wrap that whole function into it's own class that extends EventDispatcher, then have the function dispatch the result "name". You could make a custom event or use a DynamicEvent to save some time.
... View more
04-13-2011
07:53 PM
|
0
|
0
|
432
|
|
POST
|
If you use the 4.5 hero sdk with the ESRI 2.2 Flex API, you'll need to manually add the halo swc's. As described briefly here http://thunderheadxpler.blogspot.com/2010/11/how-to-use-esri-flex-api-on-android-and.html Now, to compile the application using Flash Builder Burrito, make sure to include in the libs project folder the flexapi swc and make sure to copy from the Flex sdks folder (under the burrito application folder) the mx.swc and the sparkskins.swc files. For the next release of our swc will not require the last two swc, just add them for now. The Flex team has stated before there were some comps that they use that did not have viable Spark counterparts, that should be alleviated with the final Flex 4.5 release.
... View more
04-13-2011
07:38 AM
|
0
|
0
|
409
|
|
POST
|
Since you're implementing IGraphicRenderer you can set that logic in the graphic setter. public function set graphic(value:Graphic):void{} When dealing with states in a SkinnableComponent you may need to override the following functions.
override public function initialize():void
{
super.initialize();
states.push(new State({name:"state1"}));
states.push(new State({name:"state2"}));
currentState = "state1";
}
override protected function getCurrentSkinState():String
{
return currentState;
}
override protected function stateChanged(oldState:String, newState:String, recursive:Boolean):void
{
super.stateChanged(oldState, newState, recursive);
invalidateSkinState();
}
Then in the graphic setter, change the state based on the attribute data.
... View more
04-11-2011
10:50 AM
|
0
|
0
|
350
|
|
POST
|
The GraphicEvent.GRAPHIC_ADD method is probably your best approach. I tried it out and it works on all Selection Modes and gives you access to the graphic when it is added.
package org.lacsd.layers
{
import com.esri.ags.Graphic;
import com.esri.ags.events.GraphicEvent;
import com.esri.ags.events.GraphicsLayerEvent;
import com.esri.ags.layers.FeatureLayer;
import flash.events.MouseEvent;
import mx.utils.ObjectUtil;
public class TestFeatureLayer extends FeatureLayer
{
public function TestFeatureLayer(url:String=null, proxyURL:String=null, token:String=null)
{
super(url, proxyURL, token);
this.addEventListener(GraphicEvent.GRAPHIC_ADD, onGraphicAdd);
this.addEventListener(GraphicEvent.GRAPHIC_REMOVE, onGraphicRemove);
this.addEventListener(GraphicsLayerEvent.GRAPHICS_CLEAR, onGraphicsClear);
}
private function addListener(graphic:Graphic):void
{
graphic.addEventListener(MouseEvent.MOUSE_OVER, function(event:MouseEvent):void
{
graphic.useHandCursor = true;
graphic.buttonMode = true;
map.openHandCursorVisible = false;
trace("mouse over");
});
graphic.addEventListener(MouseEvent.MOUSE_OUT, function(event:MouseEvent):void
{
graphic.useHandCursor = false;
graphic.buttonMode = false;
map.openHandCursorVisible = true;
trace("mouse out");
});
graphic.addEventListener(MouseEvent.CLICK, function(event:MouseEvent):void
{
trace("Click");
})
}
private function onGraphicAdd(event:GraphicEvent):void
{
trace("graphic has been added", ObjectUtil.toString(event.graphic.attributes));
this.addListener(event.graphic);
// add listeners here
}
private function onGraphicRemove(event:GraphicEvent):void
{
trace("graphic has been removed", ObjectUtil.toString(event.graphic.attributes));
// remove listeners here
}
private function onGraphicsClear(event:GraphicsLayerEvent):void
{
// may want to find a way to remove listeners here or add them with a weak reference
}
}
}
I think the reason you can't override the add() method for FeatureLayer is because the internal Relate/Query tasks interact directly with the GraphicsProvider/SelectedFeatures.
... View more
03-29-2011
05:56 AM
|
0
|
0
|
750
|
|
POST
|
I don't see in the docs where overriding the add() method is not supported. http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/GraphicsLayer.html#add() According to the docs you could add your listeners there, then call super.add(graphic). I usually try to assign my changes before calling the super. Or you could add a listener in your constructor for com.esri.ags.events.GraphicEvent.GRAPHIC_ADD event and do it that way.
... View more
03-26-2011
10:33 AM
|
0
|
0
|
750
|
|
POST
|
Well, not really ideal, but I fixed this by changing the s:ItemRenderer to a mx:Canvas. I'd prefer to not mix halo/spark, but it works as long as I remember to check that spark comps have been created.
... View more
03-18-2011
09:14 AM
|
0
|
0
|
356
|
|
POST
|
I am trying to set the InfoWindow title via my ItemRenderer that I am assigning to a FeatureLayer. I can set the title from the map.infoWindow.label, but my ItemRenderer doesn't have access to the map and the title will vary among FeatureLayers. All the samples are still using mx comps with inline ItemRenderers. Spark containers don't have a label field and mine are set up from ClassFactory in AS3. I tried setting the ItemRenderer label (label="{data.Type}"), but that doesn't seem to get reflected in the InfoWindow. Do I need to extend the InfoWindow to add this or is there a simpler method of setting the InfoWindow title? For example, here is my ItemRenderer that is assigned to one Featurelayer. Can I set the InfoWindow title from this ItemRenderer?
<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
autoDrawBackground="false"
label="{data.Type}">
<fx:Script>
<![CDATA[
override public function set data(value:Object):void
{
super.data = value;
// TODO - calc lat/longs, parse img data
lblCost.text = stringValue(value.COSTINFO)
lblLease.text = stringValue(value.LEASEINFO);
lblLease2.text = stringValue(value.LEASEINFO2);
lblMeter.text = stringValue(value.METERINFO);
lblElec.text = stringValue(value.ELECTRICAL);
}
private function stringValue(value:String):String
{
return (value.length > 1) ? value : "None";
}
]]>
</fx:Script>
<s:Group id="grpMain"
width="100%"
height="100%">
<s:layout>
<s:HorizontalLayout gap="8"
paddingBottom="5"
paddingLeft="5"
paddingRight="5"
paddingTop="5" />
</s:layout>
<s:Group id="fieldNames">
<s:layout>
<s:VerticalLayout gap="2" />
</s:layout>
<s:Label text="Lat:" />
<s:Label text="Long:" />
<s:Label text="Image: " />
<s:Label text="Cost Info:" />
<s:Label text="Lease Info:" />
<s:Label text="More Lease Info:" />
<s:Label text="Meter Info:" />
<s:Label text="Electrical Info:" />
</s:Group>
<s:Group id="fieldValues">
<s:layout>
<s:VerticalLayout gap="2" />
</s:layout>
<s:Label id="lblLat" />
<s:Label id="lblLong" />
<s:Label id="lblImage" />
<s:Label id="lblCost" />
<s:Label id="lblLease" />
<s:Label id="lblLease2" />
<s:Label id="lblMeter" />
<s:Label id="lblElec" />
</s:Group>
</s:Group>
</s:ItemRenderer>
... View more
03-18-2011
07:52 AM
|
0
|
1
|
701
|
|
POST
|
This thread covered how to close multiple widgets http://forums.arcgis.com/threads/25015-Closing-Multiple-Widgets But my post in there should work to close a single widget. After that, it requires a little more work.
... View more
03-09-2011
12:42 PM
|
0
|
0
|
1488
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 1 | 12-09-2025 08:20 AM | |
| 1 | 11-13-2025 03:13 PM | |
| 2 | 11-06-2025 11:10 AM | |
| 3 | 11-05-2025 02:54 PM |
| Online Status |
Online
|
| Date Last Visited |
yesterday
|