Question about findTask

703
7
04-19-2010 07:30 AM
RichardKrell
New Contributor
I am looking at the find examples and can get them to work with my data.  It will find the point or line indicate it's location by first highlighting it and then by zooming into it.  My problem though is the datagrid.  As long as I am only looking for the items described in the examples it works fine but when I start adding other datafields I get a blank.  I am using Flex Builder 3 sdk 3.2 and ArcGIS Server ver. 9.3.1.  I have included mxml file.  If someone could point me in the right direction it would be greatly appriciated.

thanks
Richard Krell
Senior Analyst
Chicago Metropolitan Agency for Planning
Chicago, Illinois
Tags (2)
0 Kudos
7 Replies
PrashanthSukumaran
New Contributor II
Hi Richard,

The problem is with the initial extent that you have specified.

If you see the mapservice for TIP Points
http://data.cmap.illinois.gov/ArcGIS/rest/services/Maps/TIP/MapServer/0

XMin: 883495.453957755
YMin: 1665586.62128334
XMax: 1203770.39280292
YMax: 2122601.04780384
Spatial Reference: 3435

Your initial extent in the code was
xmin="-89.84"

[LEFT]ymin="40.65"

xmax="-86.34"




ymax="42.97"

This caused your map to be zoomed in so close that you did not see anything.[/LEFT]

Change the initial extent to the max extent of your mapservices and you will see the base map. Find also works.


like


<esri:Extent id="mapExtent"
xmin="856295.017688914"
ymin="1586118.95073898"
xmax="1231775.46394519"
ymax="2153544.4523189"


spatialReference="{new SpatialReference(3435)}"/>


I looked up "01-97-0085" and it did return the results.

0 Kudos
RichardKrell
New Contributor
I have found that if I combine a queryTask with the findTask (i.e. click="queryTask.execute(query): doFind();") that it seems to work on the point but not the line.
0 Kudos
RichardKrell
New Contributor
Hi Richard,

The problem is with the initial extent that you have specified.

If you see the mapservice for TIP Points
http://data.cmap.illinois.gov/ArcGIS/rest/services/Maps/TIP/MapServer/0

XMin: 883495.453957755
YMin: 1665586.62128334
XMax: 1203770.39280292
YMax: 2122601.04780384
Spatial Reference: 3435

Your initial extent in the code was
xmin="-89.84"

[LEFT]ymin="40.65"

xmax="-86.34"




ymax="42.97"

This caused your map to be zoomed in so close that you did not see anything.[/LEFT]

Change the initial extent to the max extent of your mapservices and you will see the base map. Find also works.


like


<esri:Extent id="mapExtent"
xmin="856295.017688914"
ymin="1586118.95073898"
xmax="1231775.46394519"
ymax="2153544.4523189"


spatialReference="{new SpatialReference(3435)}"/>


I looked up "01-97-0085" and it did return the results.



Good observation and thanks that does work better but I don't see how it is helping me with populating the DataGrid with the results of the Find.  When you perform the find use the example as on project number and it will identify a point.  If you use 01-06-0068 that will locate a project which is a line.

also you can go to http://data.cmap.illinois.gov/tipmap to see the actual swf running.  What I posted is a cut down version that I use when trying to implement something new into the code or trying to figure out a problem like now.  In the full version I am performing both a query and a find so you will notice that the Datagrid is populated when locating a point but still nothing when locating a line since in the code for queryTask and query you can only look at one layer.
0 Kudos
PrashanthSukumaran
New Contributor II
Oh. So you want to see the data for "Agency" "Work being done" etc in the datagrid.

Am i right? If yes then you will have to create a mapservice by joining the existing feature layers(TIP Points, Tip Lines etc.) with the table that has fields for "Agency" "Work being done" etc.
0 Kudos
RichardKrell
New Contributor
the points and the lines are two seperate layers that are part of a service.  They both have identical fields and field names so there is no need to do a join.  in other words currently all the data is in the shapefiles.  Now the next part of this project will be to have them looking in a SQL table which should be fun to do.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Richard,

  Look at this thread and see what Mehul Choksey from the AGS Flex API team says about the find task and datagrids.

http://forums.arcgis.com/threads/2781-Find-Task-without-a-map
0 Kudos
RichardKrell
New Contributor
Robert,
Many, Many thanks, that was exactly what I needed.  Onward and Upward

Again thanks,
Richard Krell
0 Kudos