Select to view content in your preferred language

Sample Viewer Modifications

2168
18
09-02-2010 01:24 PM
ChadHall
Emerging Contributor
I'm brand spanking new to Flex and am fumbling my way through it.  I was able to make the modifications the mini help file (comes with the download fo the sample viewer) suggested to get accustomed to the programming but that was pretty simple stuff in my mind.

I've even been able to (today at least) show my own data within the sample viewer by placing the correct REST URL in the operational layers section of the config.xml file.  Here's where it goes haywire for me.  It's not pulling in all the layers I have in the service.  And I've updated the service to my knowledge (even created a different one) but that one's not even showing up in the Rest services directory.

So I'm stuck and I don't know how to proceed and I'm hoping this is a simple fix.  I know we've had issues with seeing services based on how our server is setup and behind a firewall (we have to use reverse proxy rules to deploy any applications).

Other issues:
1) I'm also seeing a slight issue with my sample viewer in that the measurment tool under the draw widget isn't working.  Anyone aware of this or did I mess up some code?

2) Identify: I would love to have a simple identify tool/widget that works like the example in the sample resource center but I'm so new I don't know if I'm supposed to create a new file, what kind of file, etc?  I have FlexBuilder 4 installed on my server but it's not pulling in files (other than .xml) in any readable fashion.

3) Hyperlink: Eventually I have a field setup from the ArcIMS days that I want users to be able to jump from the identify information results to the URL stated in the table.  Any suggestions on where to find this example?

Alright, sorry for the long post but I've been trying to do this all myself and I'm just not understanding the new Flex format/language.  And I don't have a neat little book like I did with ArcIMS (or I haven't found it yet) so I'm having trouble finding example and simple start up information.  Thanks in advance for any help provided and I'll be more than willing to share any code or files if needed to come to a solution.

Thanks
Chad
Tags (2)
0 Kudos
18 Replies
RobertScheitlin__GISP
MVP Emeritus
Chad,

   OK, lets start with a question... Do you know the REST Admin page is and how to get to it? Basically if you make a change to a map service you have to clear the REST cache before you will see the change. http://localhost/arcgis/rest/admin

Next for those map services that you have that certain layers are not showing up is that simply because they have a scale dependency setup on them? When you go to your REST Services directory and click on one of your map services at the top there will be

View In:   ArcMap   ArcGIS Explorer   ArcGIS JavaScript   Google Earth   ArcGIS.com Map

press ArcGIS JavaScript  and zoom around your map service do those layers show up?

1. I am not sure why your measure is not working
2 and 3. you need to wait another month (without the schedule slipping) and FlexViewer 2.1 will be out and will have these taken care of as far as I have heard.
0 Kudos
ChadHall
Emerging Contributor
Robert,

Thank you for the response.  I wasn't aware of the Admin cache.  Cleared it out and voila it worked!

Regarding the draw tool and the hyperlink, I'll wait for the new version and hopefully that'll alleviate the issues.

If I could beg, borrow or steal some more of your time, I have another couple questions.  I modified the search widget so that it would search my local layers (the same ones I was having trouble getting to show properly).  It appears the text string search must be exact and not a partial match.  Is there any way to change this?  Also, below is the code for searching one of the layers in the search widget.  When it does find a record, it returns the title of the record and two lines of "null:1324.1232424354" or a slight variation of the numbers.  Does that mean I have the <fields><titlefield> and <linkfield> coded improperly?
*******************
<layer>
            <name>Construction Sites</name>
            <url>http://gis2.jonescarter.com/arcgis/rest/services/Server/MapServer/3</url>
            <expression>NAME = '[value]'</expression>
            <textsearchlabel>Search by Site Name  [ Example: Baylor 4 No. 2 Alt ]:</textsearchlabel>
            <graphicalsearchlabel>Use one of the graphical search tools to select under construction sites</graphicalsearchlabel>
            <fields>NAME</fields>
            <titlefield>NAME</titlefield>
            <linkfield>HYPERLINK</linkfield>
</layer>
*****************
Finally, regarding the identify code on the sample resource center (or any of the code there), is it a new file, insert into existing file, etc?  I'm just trying to wrap my brain around the new processes here and I'm struggling.

Thank you so much for the help already.  It's a tremendous improvement from where I was.

Chad
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Chad,

   The issue with having to type exactly what you are searching for is an easy fix just replace

<expression>NAME = '[value]'</expression>
with
<expression>NAME LIKE '%[value]%'</expression>


Next your list of fields needs to include all the fields you are going to use separated by a comma.
So add the hyperlink field into your list of fields.

In regards to widgets that you can download from the code gallery you have to ensure they are developed for the particular FlexViewer version that you are working with. So the identify widget on the code gallery is a 1.x version and will not work for the FlexViewer2.0.
0 Kudos
ChadHall
Emerging Contributor
Thanks again Robert.  I will try that out and get it working.  I also perused a couple more threads and found the Developer's Guide by Moxie.  I'll dive into that and see if clears any other clouds in my head.  Thanks again for the help!

Chad
0 Kudos
CattyannCampbell
Frequent Contributor
How does one get the identify tool to work in SFV 2.0? Did ESRI kill the identify capability in 2 or did I miss something?


Chad,

   The issue with having to type exactly what you are searching for is an easy fix just replace

<expression>NAME = '[value]'</expression>
with
<expression>NAME LIKE '%[value]%'</expression>
Next your list of fields needs to include all the fields you are going to use separated by a comma.
So add the hyperlink field into your list of fields.

In regards to widgets that you can download from the code gallery you have to ensure they are developed for the particular FlexViewer version that you are working with. So the identify widget on the code gallery is a 1.x version and will not work for the FlexViewer2.0.
0 Kudos
MelissaJohnson
Frequent Contributor
I am also looking for an identify widget for my 2.0 viewer.  If anyone could point me in the right direction to locate one it would be much appreciated.  Will this be included in 2.1?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
From the sounds of it, there will be a pretty nice one in FlexViewer 2.1. Just a few more days to wait.
0 Kudos
MelissaJohnson
Frequent Contributor
Yea!!!! Thanks!
0 Kudos
BjornSvensson
Esri Regular Contributor
identify widget for my 2.0 viewer.... Will this be included in 2.1?


Nope, no identify widget in ArcGIS Viewer for Flex 2.1.

However, depending on what you want to do, there is some "identify" functionality in 2.0.  You can click on features and get a popup that shows information for that feature.  This is the concept of "info popups".  These are supported both if the feature was added as an operational layer of type "feature" (which could point to any layer in a MapService or FeatureService) or as a result from GeoRSS, Search, or Query widget.
0 Kudos