Select to view content in your preferred language

Identify Widget for FlexViewer 2.1

61361
266
09-23-2010 11:34 AM
RobertScheitlin__GISP
MVP Emeritus
All,

   I have been waiting for the Final release of the FlexViewer 2.1 before I started to push out some widgets I have been working on.

Here is my Identify Widget for Flex Viewer 2.1. I have tested to ensure proper functioning with FlexViewer 2.1 and am now releasing it to you since the API Team did not get one into the FlexViewer.

Here is the link:

http://www.arcgis.com/home/item.html?id=39cf66d58c234279ba728c50461a1a89

More FlexViewer 2.1 widgets to come stay tuned...
Tags (2)
0 Kudos
266 Replies
TimMcKinney
Deactivated User
Robert,

Thanks for the quick response. I just discovered that with HttpFox.  Thanks for the suggestion earlier in this thread.  It's working now.  And thanks for this useful widget!

Tim
0 Kudos
MattEitrem
Regular Contributor
Is there a way to exclude specific services or layers from being returned by this tool using only the widget config xml file? I would like to only id on features I have specified as operational layers in the viewer and not the base layers.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Matt,

   Currently no.
0 Kudos
MarcWeinshenker1
Regular Contributor
I was trying to duplicate the results you had on the excluding all layers not in the IdentifyWidget.xml by commenting out the else block in the function called processIdentifyResults. I then recomplied it but i still get the layers to show up that are not in the IdentifyWidget.xml.

Here is the function with the code i commented out. I've try to clean the project, and build but i still get the layers to show up i didn't want to see.

 
   //process identify results
   private function processIdentifyResults(identifyResults:Array):void
   {
    if(!identifyArrayCollection)
     identifyArrayCollection = new ArrayCollection();
    for each (var identifyResult:IdentifyResult in identifyResults)
    {
     var title:String = identifyResult.layerName;
     var obj:Object = identifyResult.feature.attributes;
     var content:String = "";
     var fld:String;
     var value:String;
     var link:String = "";
     var linkicon:String = "";
     var identFields:String = "";
     var identLinkPre:String = "";
     var identLinkField:String = "";
     var identLinkSuffix:String = "";
     var identLinkIcon:String = "";
     var identLinkIconPre:String = "";
     var identLinkIconSuffix:String = "";
     var identZoom:Number = 0;
     var identForceScale:Boolean = false;
     
     for(var i:int=0; i<configIdentFields.length; i++)
     {
      if (identifyResult.layerName == configIdentFields.label)
      {
       identLinkField = configIdentFields.linkfield;
       identFields = configIdentFields.fields;
       identLinkPre = configIdentFields.linkpre;
       identLinkSuffix = configIdentFields.linksuffix;
       identLinkIconPre = configIdentFields.linkiconpre;
       identLinkIcon = configIdentFields.linkicon;
       identLinkIconSuffix = configIdentFields.linkiconsuffix;
       identZoom = configIdentFields.zoomscale;
       identForceScale = configIdentFields.forcescale;
      }
     }
     
     if(identFields) {
      var fldArr:Array = identFields.split(",");
      for (var f:Number = 0; f < fldArr.length; f++) {
       try{                            
        value = obj[fldArr].toString();
       } catch (error: Error){
        value = "";
       }
       if (fldArr.toUpperCase() == identLinkField.toUpperCase()){
        //concatenate
        link = identLinkPre + value + identLinkSuffix;
       } else if (fldArr.toUpperCase() == identLinkIcon.toUpperCase()){
        //concatenate
        linkicon = identLinkIconPre + value + identLinkIconSuffix;
       } else {
        content += fldArr + ": " + value + "\n";
       } 
      }
     } /* else {
      for (fld in obj)
      {
       try{                            
        value = obj[fld].toString();
       } catch (error: Error){
        value = "";
       }
       
       if (fld.toUpperCase() == identLinkField.toUpperCase())
       {
        link = value;
       } else {
        content += fld + ": " + value + "\n";
       }
      }  
     } */

     var idResult:IdResult = new IdResult();
     idResult.icon = widgetIcon;
     idResult.title = identifyResult.layerName;
     idResult.content = content;
     if(link!="")
      idResult.link = link;
     idResult.point = identifyPoint;
     idResult.geometry = identifyPoint;
     idResult.zoomScale = identZoom;
     idResult.zoom2msg = zoom2Msg;
     if(linkicon!="")
      idResult.linkicon = linkicon;
     idResult.forceScale = identForceScale;
     identifyArrayCollection.addItem(idResult);

    }
    clearMessage();
   }


It's probably something simple that i'm not seeing. Any Ideas? Also, i'm using Flash builder 4 to rebuild the mxml.

Thanks.


I think you are commenting out the same place I am, so I don't really have an explanation.  One other thing I am doing, though, is forcing no Identify results from tiled layers by hard coding the url variable to "" in the else if (layer is ArgGISTiledMapServiceLayer) conditional in the identifyFeatures function.  That may be unrelated, though.

Marc
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Andrea,

   I actually did email you. I wonder if your spam got my email... I am glad you got it worked out, but I will have to look into why it did not work the way you first had it.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Andrea,

   I found the issue you were experiencing and fixed it in the 2.1.4 release. If you want to or need to switch your operational layers back to the way you had them then the new version will work with them that way.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
All,
   A new Version that supports only identifying the layers that are specified in the IdentifyWidget.xml is now available.
0 Kudos
philippschnetzer
Frequent Contributor
Encountering some odd behaviour..

Just installed version 2.1.4 and set <keepidentifyactive>true</keepidentifyactive>.

When i minimize or close the widget I still have the 'Click to Add Point' label attached to my cursor...then I can click to get rid of it but whenever the cursor touches another widget or the header area the label comes back...

Did not have this issue in 2.1.3

Thanks!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
All,

   Yet another version 2.1.5 fixes the issue that several people including myself have with the draw tool tips showing when using this widget. Also Phillip identified a issue with the widget even when closed still showing the draw tool tips. These have been fixed in this latest version.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Andrea,

    There is a new version again (2.1.6). That fixes the issue with not being able to click on the hyperlink in the info popup. For your second point that is just the standard that ESRI started and for me to change from that now would break other enhancements that user have asked for. The Third comment of your is just the way that it is. The identify results are returned using the field alias and not the true field name from the identify task so that is all I have to work with.
0 Kudos