Select to view content in your preferred language

Metadata (and the TOC Widget)

981
28
05-27-2011 01:19 PM
JustinRobinson
New Contributor III
Hey all,

I was wonder how people out there are satisfying metadata requirements for their online maps?

I'm currently migrating an ArcIMS/IMF implementation to ArcServer and the Flex Viewer and I'm running into problems. In the IMS/IMF implementation clicking on the name of the layer would open up a new window with the metadata (or the sci. report that generated the data), this could also be achieved by an icon to the right of the layer name. Both were "simple" to implement, mostly due to IMF.

However, I'm now having difficulty figuring out how to implement something similar within the TOC Widget created by Robert (it is most excellent, many thanks Robert). I've contemplated trying to create an icon to the right--failing miserably, I'm not even exactly sure where to start with this beyond it being within TocItemRenderer.as.
I've also tried to make use of the doubleClick (onCheckBoxClick) that is detected for each item, and yet again fail to quite wrap my brain around it. Suffice to say, my level of AS3 programming ability and complete API knowledge seems to be somewhat limited.

In addition to this I've tried to figure out if it was possible to do in the PopUps, however <![CDATA[ is not supported in the <title>, so I can't make the title link to a URL. I could use <description>, however that would mean writing a custom <description> element for every single layer (when there are over 150). Time and time again I see people warning that editing the structure of the popUps to be extremely difficult.

There must be an elegant way to show metadata either through the TOC or through the PopUps.
Has anyone come up with a method to do this, or can anyone offer some suggestions in order to accomplish this?

Thanks.
Tags (2)
0 Kudos
28 Replies
RobertScheitlin__GISP
MVP Emeritus
Justin,

   Back in the SFV 1.x days I had a version of my TOC widget that had a button for opening a url that went to an ASP.net webservice and displayed some CANNED xml metadata file in a virtual directory. I did not carry that over as it was over most peoples head how to configure it, but it can be done. The easiest solution you can come up with immediately with little effort at all is to open the MXD that serves the map service and for each layer type metadata in the description field and copyright field. The current version of the TOC widget will display this info as a tooltip.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Justin,

  Here is the old thread I referenced above.

http://forums.esri.com/thread.asp?c=158&f=2421&t=290218
0 Kudos
JustinRobinson
New Contributor III
Thanks Robert, however I'm not sure I need something quite so advanced. Unfortunately the metadata is not embedded in SDE. I'm hoping to find something similar to effect as pop-ups. I'm beginning to think that modifying the popups might be the way to go... I may have to research how to do this. If I could display both the <fields> and <description> at the same time (which should be the default behaviour, I'm not sure why that decision is/was made for us) I would be able to include the link that I require. Either that or find a way to allow <![CDATA[[ ]]> in the <title> tag... back to the drawing board.

Anyone else out there have novel/alternative ideas that I may be overlooking?
0 Kudos
JustinRobinson
New Contributor III
Here is the edit to the PopUp skin that allows for display of both <description> and <fields> simultaneously (if they both exist) for those that would like it. Not much of an edit, but changes are spread throughout the .mxml file, therefore it was easier to distribute through this method.

From the ReadMe.txt
***************************************************************
DescFieldPopUp -- Description + Fields PopUp
Justin Robinson 2011
***************************************************************

The Purpose of this file is to allow for the display of both
<description> and <fields> tags (if both exist) on pop-ups
called from a widget (or from base).

To Utilise for all calls add the following to your default.css:

----------------

esri|PopUpRenderer
{
 skinClass:ClassReference('widgets.DescFieldPopUps.DescFieldPopUps');
}

----------------

For using with a single widget add the above within your <fx:style> tag


This solves my problem, however not the BEST way (that'd be a link in the table of contents) but a much EASIER way.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Justin,

   I have updated the 2.3.4 version of the TOC widget to have a details button that opens an alert window with layer details, and many more enhancements.

Version 2.3.4 - 2 June, 2011
* Removed white background from legend.
* Added ability to exclude basemaps from the legend (this is now the default).
* Verified that classified rasters are now supported if you are using ArcGIS Server SP1 or greater
* Set the legend timeout to 60 Seconds for those with slow servers (configurable in xml)
* Added better handling of layers that come from a slow server when it comes to building the legend
* Added ability to internationalize the text for transparency slider tooltip, layer details button tooltip,
  Context menus.
* Transparency/Opacity is now controlled by one slider at the top of the widget. You but select a map service
  in the TOC for it to become enabled.
* Added Zoom to Layer Extent context menu for individual map service layers
* Added Map Service description button and individual layer description and copyright alert when details button
is pressed. Details button can be disabled in TOCWidget.xml
0 Kudos
FrankRoberts
Occasional Contributor III
Robert, I like the new release!  I've been going through your code and trying to figure out what event triggers your  metadata button.  Can you enlighten me?  I need to come up with a custom way to display the metadata.

Thanks yet again!
Frank
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Frank,

   The ShowMeta function is WAY down in the TocItemRenderer.as code. I have noticed that the Alert dialog that I use is not working very well for big descriptions. I will be releasing another version that uses a custom popup to handle html tags (the supported ones) and large descriptions.
0 Kudos
FrankRoberts
Occasional Contributor III
Thanks, I was looked high and low for it yesterday, just not in the right spot...  I hope they build out the API out so we can get better access to the metadata.  I'm thinking about just putting a url back to the metadata record in the description of the layers in the mxd so I can get back to the metadata.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
All,

   My new version 2.3.5 that combines the TOC and Legend is now available as well as other improvements.
0 Kudos