private function identifyFeatures():void { var identifyParams : IdentifyParameters = new IdentifyParameters(); identifyParams.returnGeometry = false; identifyParams.tolerance = identifyTolerance; identifyParams.geometry = identifyPoint; identifyParams.width = map.width; identifyParams.height = map.height; identifyParams.mapExtent = map.extent; identifyParams.spatialReference = map.spatialReference; //You have to know the id number of your layer here identifyParams.layerIds = [23]; var identifyTask:IdentifyTask = new IdentifyTask("http://yourserver/arcgis/yourservice/mapserver); identifyTask.addEventListener(IdentifyEvent.EXECUTE_COMPLETE, onResult); identifyTask.addEventListener(FaultEvent.FAULT, onFault); identifyTask.execute(identifyParams); showMessage(loadingLabel, true); showStateResults(); }
Will,
If you only want one layer of one particular map service and that is it than you need to look at the identifyFeatures function in the IdentifyWidget.mxml and basically delete all the for loop an just hard code the identifyParams and identify task something like thisprivate function identifyFeatures():void { var identifyParams : IdentifyParameters = new IdentifyParameters(); identifyParams.returnGeometry = false; identifyParams.tolerance = identifyTolerance; identifyParams.geometry = identifyPoint; identifyParams.width = map.width; identifyParams.height = map.height; identifyParams.mapExtent = map.extent; identifyParams.spatialReference = map.spatialReference; //You have to know the id number of your layer here identifyParams.layerIds = [23]; var identifyTask:IdentifyTask = new IdentifyTask("http://yourserver/arcgis/yourservice/mapserver); identifyTask.addEventListener(IdentifyEvent.EXECUTE_COMPLETE, onResult); identifyTask.addEventListener(FaultEvent.FAULT, onFault); identifyTask.execute(identifyParams); showMessage(loadingLabel, true); showStateResults(); }
<labels> <zoom2message>Test - Click to Zoom to Point</zoom2message> <identifylabel>Identify</identifylabel> <resultslabel>Results</resultslabel> <descriptionlabel>Use the identify tool to identify features on the map:</descriptionlabel> <pointlabel>Identify</pointlabel> <clearlabel>Clear</clearlabel> <loadinglabel>Loading...</loadinglabel> <selectionlabel>Features Identified:</selectionlabel> </labels>
The options "top", "visible:1" or "all:2,4" have strange behaviour when you have more operational mapservices. If you have 2 mapservices, the result of "top" gives you 2 layers back!
As far as the keeping the identify tool active after the initial identify all you need to do is add activateIdentifyTool(); in to the drawEnd function. I will add an option for this to the config.
For the mousing over the graphic this has never been available for the identify because you need to consider which layer you would display the results for since all the layers are identified using the same exact point. This is just not feasible.