Select to view content in your preferred language

Identify Widget Question

4032
59
05-20-2011 11:38 AM
TomSedlacek
Regular Contributor
This question pertians to Robert Scheitlins' Identify Widget 2.3.1.
I have added the widget to my web app and it's exactly what I'm looking for.  HOWEVER, it only seems to identify those layers that are a part of my basemap.  I've modified the "onlythese" code in the compiled version six ways from Sunday and it will not id any of the layers in my 'operational layers'.

Any ideas anyone?  Robert?

Thanks!

Tom Sedlacek GISP
Engineering Tech / GIS
Clark Regional Wastewater District
360-993-8811
Email: TSedlacek@CRWWD.com
Tags (2)
0 Kudos
59 Replies
RhettZufelt
MVP Notable Contributor
I have it set to <layers onlythese="false">.

However, if I have a layer listed below ( in the <layer> tags), it will "try" to map according to the <field> tags, but will NOT honor <fields all="true" />.

I.e., I have a building layer in my map, if I click on it with the idetify with the following settings:  <fields all="true" />, the infowindow will popup with the layer name, but no attribute information.
If I actually map some fields
<fields all="false">
<field name="name" />
<field name="DEC_UNIT" popuponly="true" />
</fields>


then, I will get information for those fields.

ALSO, the other option is to remove the "Buildings" layer from my identifywidget.xml.  Then, ALL attributes are displayed.

So, if you want to get all info for all visible layers, try removing them from the xml and see if that makes a difference (makes it behave like <fields all="true" /> ).

Hope this helps figure something out,

R_
0 Kudos
JORGELAGOS2
Emerging Contributor
I have it set to <layers onlythese="false">.

However, if I have a layer listed below ( in the <layer> tags), it will "try" to map according to the <field> tags, but will NOT honor <fields all="true" />.

I.e., I have a building layer in my map, if I click on it with the idetify with the following settings:  <fields all="true" />, the infowindow will popup with the layer name, but no attribute information.
If I actually map some fields
<fields all="false">
<field name="name" />
<field name="DEC_UNIT" popuponly="true" />
</fields>


then, I will get information for those fields.

ALSO, the other option is to remove the "Buildings" layer from my identifywidget.xml.  Then, ALL attributes are displayed.

So, if you want to get all info for all visible layers, try removing them from the xml and see if that makes a difference (makes it behave like <fields all="true" /> ).

Hope this helps figure something out,

R_


Thanks for your help but it seems to me we are having the same issues.
If I select layers onlythese="false" then all the layers and all the fields will show but I want to show only one layer then I have to set
layers onlythese="true" then I would like to list all the fields for my unique layer without having to actually code them.

Jorge
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jorge,

   I am aware of this issue, but as it is just a convience issue and not a real bug it has a low priority for me. As the developer of this widget I regret even adding the fields all option as it has made many people lazy and they do not take the time to truly question if a field is really necessary in there results for their particular web app.
0 Kudos
RhettZufelt
MVP Notable Contributor
I for one am glad you included it.  I do type "most" of my required fields, however, the fields all="true" is the only way I have figured out how to get the FV to report the pixel values of a raster map service.  Try to limit the fields at all and no data,
<fields all="true" />
gives you the raster cell values at least.

R_
0 Kudos
SerenaO_Connor
Emerging Contributor
Hi Robert,

I was wondering if you could help me. I am a newbie to Flexviewer and have tried to include two additional widgets in my application
(Identify and TOC). I have copied the widget file over to the correct location and the code to my config file.
However I am getting the following error.

Error: Could not find compiled resource bundle 'ViewerStrings' for locale 'en_US'.
at mx.resources::ResourceManagerImpl/installCompiledResourceBundle()
at mx.resources::ResourceManagerImpl/installCompiledResourceBundles()
at mx.core::FlexModuleFactory/installCompiledResourceBundles()
at mx.core::FlexModuleFactory/docFrameHandler()
at mx.core::FlexModuleFactory/docFrameListener()

Would you have any ideas?
Any help would be much appreciated.

Sconnors
(Ireland)
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Serena,

   What do your additional compiler arguments look like for your project when you look at your projects properties > Flex Compiler?
0 Kudos
JORGELAGOS2
Emerging Contributor
Hello Robert,

I know your Identify tool offers the option to exclude basemap but I would actually would like to exclude the State layer from the selection. The State layer is part of my mapservice and is included as an operational layer.

Thanks in advance

Jorge
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jorge,

   The way to do this is to use the onlythese equals true attribute and then define the layers and fields you DO want returned.
0 Kudos
TrishRempel
Occasional Contributor
Hi Jorge,

I also wanted to specify <layers onlythese="false"> but also provide layers to exclude, so I added some lines to the config file and to the Identify Widget.

IdentifyWidget.xml:

<layers onlythese="false">
</layers>
<excludeLayers>
 <excludeLayer name="LayerName" />
</excludeLayers>


IdentifyWidget.mxml

1. Add the following to the variable declarations:

private var configExcludeLayers:Array;


2. Add the following to private function init():void, after if (configXML) {:

configExcludeLayers = [];
var excludeLayerList:XMLList = configXML..excludeLayer;
for (var index:int = 0; index < excludeLayerList.length(); index++) {
 configExcludeLayers.push(excludeLayerList[index].@name);
}


3. Add the following to private function onResult(identifyResults:Array, arcL:* = null):void, after for each (var identifyResult:IdentifyResult in identifyResults) {:

var exclude:Boolean = false;
for (var index:int=0; index < configExcludeLayers.length; index++) {
 if (identifyResult.layerName == configExcludeLayers[index]) {
  exclude = true;
  break;
 }
}
if (exclude)
 break;
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Trish,

   How do you feel about this code being added to the identify widget?
0 Kudos