if (layer is FeatureLayer) { var featLayer:FeatureLayer = layer as FeatureLayer; url = featLayer.url; var layId:int = -1; var arcDL:ArcGISDynamicMapServiceLayer; if( url.indexOf("FeatureServer") > -1) { var msName:String = url.replace("FeatureServer","MapServer"); arcDL = new ArcGISDynamicMapServiceLayer(msName.substring(0,msName.lastIndexOf("/"))); url = arcDL.url; layId = parseInt(msName.substring(msName.lastIndexOf("/")+ 1)); }else{ arcDL = new ArcGISDynamicMapServiceLayer(url.substring(0,url.lastIndexOf("/"))); layId = parseInt(url.substring(url.lastIndexOf("/")+ 1)); url = arcDL.url; } if(identifyLayerOption == "visible") { if(layId != -1) identifyParams.layerIds = [layId]; if(featLayer.visible == false) url=""; } }
Placing the FeatureLayer inside the Map tag would require listing everyone of those fields I would potentially need to query in the Outfields, correct?
So what I'm hearing is that you cannot (or shouldn't) place the URL of a FeatureService in the identifyTask MXML tag, correct?
Identify on FeatureLayer using Coordinates
for each (var gr:Graphic in featureLayer.graphicProvider) { // find geometry and get fields }
Just trying it with FeatureService
Sorry, but I do not understand why IdentifyTask needed?1 - FeatureLayer has default MXML property graphicProvider= ArrayCollection of all the graphics currently in the layer. Each of graphics has geometry.2 - FeatureLayer has public property outFields.3 - Well - you have array of geometries(graphicProvider) on client side and fields(outFields) on client side. Tell me why new server call(IdentifyTask) needed? Or I'm missing something?Thanks.
URL to the ArcGIS Server REST resource that represents a map layer
Russell, You can but... What is your end game??? The identify task is suited for clicking on a map and having it return results from all map services that are included in that map including featureLayers. If you are just trying to get specific info about the actual feature (graphic) that you click on then why not just use the info window or the new 2.3 PopUpInfo?
Russell, Oh... If you are talking about a FeatureLayer than the info window that is poped up when you click on the feature has nothing to do with the identifyTask. Is that what you are talking about?
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.