|
POST
|
Looking at your code I can see that "myGraphic" has no attributes assigned to it, so when you compare onMouseOver its finding null for the attributes property. Add the following code where you build myGraphic
myGraphic.attributes = addressCandidate;
As for zooming from the datagrid I would search "Zoom to Point" in the forum and I am sure you will find some existing samples out there. Drew
... View more
12-08-2010
07:45 AM
|
0
|
0
|
508
|
|
POST
|
Thanks Drew. It worked. Do you know if there is way to populate the combobox without using "QueryData" function so I do not have to push the "Load Data" button. nshaukat you will want to do it on creationComplete sample
<?xml version="1.0" encoding="utf-8"?>
<mx:Application creationComplete="creationCompleteHandler(event)"
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
xmlns:esri="http://www.esri.com/2008/ags">
<mx:Script>
<![CDATA[
import com.esri.ags.FeatureSet;
import com.esri.ags.Graphic;
import com.esri.ags.events.QueryEvent;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.events.FlexEvent;
protected function creationCompleteHandler(event:FlexEvent):void
{
queryData();
}
private function queryData():void
{
queryTask.execute(query);
queryTask.addEventListener(QueryEvent.EXECUTE_COMPLETE, onQueryComplete);
}
private function onQueryComplete(event:QueryEvent):void
{
var featureSet:FeatureSet = event.featureSet;
var results:ArrayCollection = new ArrayCollection();
for each (var graphic:Graphic in featureSet.features)
{
var fieldValue:String = graphic.attributes["STATE_NAME"].toString();
results.addItem({label: fieldValue, data:graphic});
}
cmb.labelField = "label";
cmb.dataProvider = results;
}
]]>
</mx:Script>
<esri:QueryTask
id="queryTask"
useAMF="false"
url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5"/>
<esri:Query
id="query"
returnGeometry="false"
where="1=1"
outFields='["STATE_NAME"]'/>
<mx:ComboBox id="cmb" x="179" y="205" labelField=""></mx:ComboBox>
</mx:Application>
... View more
12-05-2010
06:35 PM
|
0
|
0
|
1449
|
|
POST
|
Here is an upgraded version for the 2.1 lib.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:esri="http://www.esri.com/2008/ags">
<mx:Script>
<![CDATA[
import com.esri.ags.FeatureSet;
import com.esri.ags.Graphic;
import com.esri.ags.events.QueryEvent;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
private function queryData():void
{
queryTask.execute(query);
queryTask.addEventListener(QueryEvent.EXECUTE_COMPLETE, onQueryComplete);
}
private function onQueryComplete(event:QueryEvent):void
{
var featureSet:FeatureSet = event.featureSet;
var results:ArrayCollection = new ArrayCollection();
for each (var graphic:Graphic in featureSet.features)
{
var fieldValue:String = graphic.attributes["STATE_NAME"].toString();
results.addItem({label: fieldValue, data:graphic});
}
cmb.labelField = "label";
cmb.dataProvider = results;
}
]]>
</mx:Script>
<esri:QueryTask
id="queryTask"
useAMF="false"
url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5"/>
<esri:Query
id="query"
returnGeometry="false"
where="1=1"
outFields='["STATE_NAME"]'/>
<mx:ComboBox id="cmb" x="179" y="205" labelField=""></mx:ComboBox>
<mx:Button x="87" y="205" label="Load Data" click="queryData();"/>
</mx:Application>
Drew
... View more
12-05-2010
05:07 PM
|
0
|
0
|
1449
|
|
POST
|
It could be a AGS Flex API version issue that's causing the problem. The sample provided looks like its using the 1.3 lib.
... View more
12-05-2010
05:03 PM
|
0
|
0
|
1449
|
|
POST
|
I want to clip Raster dataset ( present into Geodatabase) based on extent drawn by user on map and export it into Tiff format. then user should be able to download this file I'm using Flex 2.0 APIS I don't know if this tool is what you are exactly looking for, but it might be a start. Snapshot Widget for FlexViewer 2.1 http://forums.arcgis.com/threads/15660-A-Snapshot-Widget-for-FlexViewer-2.1 It sounds like you are not using the Flex Viewer so the linked widgets source code might help you more.
... View more
12-05-2010
05:33 AM
|
0
|
0
|
823
|
|
POST
|
how to get the agslib 's source ? I just find the flexView 's source, it have a reference to agslib.swf. please send to me,thanks ! email:ahshfh@gmail.com I assume you mean the agslib.SWC, correct? The agslib swc file is not available as source code......... but you can download the swc file here http://resources.arcgis.com/content/arcgis-flex-api-how-to-download Drew
... View more
12-04-2010
07:53 PM
|
0
|
0
|
478
|
|
POST
|
You have the variable �??lastIdentifyResultGraphic�?� defined twice in this document. Once on line 32 and once on line 93. This is what�??s causing the error.
... View more
11-29-2010
10:17 AM
|
0
|
0
|
396
|
|
POST
|
If want to do this on the web using Flex you should use a web service written in some sort of server side language. Because you mentioned SQL Server, .NET is probably the way you want to go. You can write a WCF or ASP.NET web service to pull the data form the DB and then have Flex consume that web service. One nice thing about web services is that generally they can be consumed by anything. So you could write the service and consume it in Flex, Silverlight, Windows Forms, WPF etc... If .NET is the way you want to go simply Google .NET Web Services for samples.
... View more
11-24-2010
02:26 PM
|
0
|
0
|
732
|
|
POST
|
The reason why your query is not zooming to the feature is because your returned gemetry is a MapPoint and a MapPoint does not have an extent. So the GraphicUtil.getGraphicsExtent(featureSet.features); method is returning null because its unable to calculate. I cant say for sure but that method might return an extent if there is more than 1 MapPoint returned, but i think a single result (like you have) will always return null if its a map point. Try searching "zoom to point" in the forums and I am sure you will stumble on some code similar to this thread.. http://forums.arcgis.com/threads/7847-Zoom-to-a-single-point!?highlight=zoom+point Drew
... View more
11-23-2010
04:42 PM
|
0
|
0
|
704
|
|
POST
|
The reason why your map is not showing up is because all your layers have a min scale and the map being generated is probably outside the min scale of 1:100,000 as defined in your township layer. Adjust or remove the min scale on your township layer, refresh your map service and clear the rest cache. That should fix your issue. You can test the current problem by zooming in on your map. You will notice the features eventually come into view. Drew
... View more
11-23-2010
03:28 PM
|
0
|
0
|
704
|
|
POST
|
Use the headerStyleName property on the DataGrid to style your header. sample
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
@namespace esri "http://www.esri.com/2008/ags";
.headerStyle
{
font-weight:bold;
}
</fx:Style>
<mx:DataGrid headerStyleName="headerStyle" id="resultsGrid" width="100%" height="100%">
</mx:DataGrid>
Drew
... View more
11-19-2010
10:07 AM
|
0
|
0
|
562
|
|
POST
|
After looking closer, something is wrong in your code. You have �??QueryTask�?� declared twice. Once in Markup and once in code�?� Remove the lines I outlined below.
[Inject("queryTask")]
public var queryTask:QueryTask=new QueryTask();
... View more
11-18-2010
07:49 AM
|
0
|
0
|
543
|
|
POST
|
Try setting useAMF="false" on the query task. http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/tasks/QueryTask.html#useAMF Drew
... View more
11-18-2010
06:59 AM
|
0
|
0
|
543
|
|
POST
|
Dan, What you need to do is create some sort of map service with your data, then use the ESRI Flex Viewer to start building your application. http://help.arcgis.com/en/webapps/flexviewer/index.html But generally speaking you need a map service to start showing your own data. There are a few types of map services the Flex API can handle so there are some options. Usually a map service is created using ArcGIS Server Other links for you. ESRI Flex API Samples: http://help.arcgis.com/en/webapi/flex/samples/index.html ESRI Flex API Concepts http://help.arcgis.com/en/webapi/flex/help/index.html Understanding ArcGIS Server http://help.arcgis.com/en/webapi/flex/help/content/arcgis_server/arcgis_server_overview.htm
... View more
11-18-2010
04:04 AM
|
0
|
0
|
856
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-04-2013 09:40 AM | |
| 1 | 12-11-2012 10:19 AM | |
| 1 | 05-25-2015 10:46 AM | |
| 1 | 05-10-2016 06:31 AM | |
| 1 | 01-17-2017 11:01 AM |
| Online Status |
Offline
|
| Date Last Visited |
12-31-2021
09:54 AM
|