Select to view content in your preferred language

Get layer ID from FeatureSet

1276
5
08-04-2010 05:21 AM
LukeEvans
Emerging Contributor
Hi,

I currently have a problem where I need to be able to retrieve the layer ID from the feature set I am provided with.  I can't seem to see anywhere this is possible without knowing which layer the initial query was executed on.  Can anyone help?

Thanks

Luke
Tags (2)
0 Kudos
5 Replies
MLowry
by
Frequent Contributor
Does this belong in the Flex forum for any reason?

Use this URL and replace "server" with the name of the server the services reside on and drill down to the service:

http://www.server.com/ArcGIS/rest/services
0 Kudos
LukeEvans
Emerging Contributor
Does this belong in the Flex forum for any reason?

Use this URL and replace "server" with the name of the server the services reside on and drill down to the service:

http://www.server.com/ArcGIS/rest/services


I don't think you quite understood what I was asking.  I have already executed a Query in Flex.  In the query result method I have a FeatureSet returned from the server.  I wondered if there was any way of knowing which layer this query was performed on, solely from the FeatureSet returned.

I'm having this issue because I am running multiple queries, with each possibly using a different layer and different geometry.  As these are asynchronous calls, how am I to be certain which result belongs to which query (and therefore which layer)?
0 Kudos
MarnikBlomme
Emerging Contributor
Add the reference to your layer when you do the query like:

queryTask.execute(query, new AsyncResponder(onResult, onFault, myLayerID));

Then define your result handler like :

function onResult(featureSet:FeatureSet, myLayerID:Number):void
{
...
}
0 Kudos
LukeEvans
Emerging Contributor
Add the reference to your layer when you do the query like:

queryTask.execute(query, new AsyncResponder(onResult, onFault, myLayerID));

Then define your result handler like :

function onResult(featureSet:FeatureSet, myLayerID:Number):void
{
...
}


Perfect!  Thanks a lot for your help.
0 Kudos
MLowry
by
Frequent Contributor
I don't think you quite understood what I was asking.  I have already executed a Query in Flex.  In the query result method I have a FeatureSet returned from the server.  I wondered if there was any way of knowing which layer this query was performed on, solely from the FeatureSet returned.

I'm having this issue because I am running multiple queries, with each possibly using a different layer and different geometry.  As these are asynchronous calls, how am I to be certain which result belongs to which query (and therefore which layer)?


Sorry about that! I misunderstood the question.

Glad you got it worked out!
0 Kudos