Select to view content in your preferred language

Adding Own Data to Flex Viewer

1847
18
10-20-2010 03:49 PM
NeilMillward
Regular Contributor
I am trying to add an operational layer of points to the flex viewer. I have added the layer in the config.xml file and I don't get any error messages when the viewer loads, I just don't see any of the points on the map.

I have checked the url to the service and this is working.

My points are in State Plane Projection and the base layers are Web Mercator. Could this be the problem?

Thanks
Tags (2)
0 Kudos
18 Replies
NeilMillward
Regular Contributor
I am still unable to get the info window to work. I can get a window to pop up when I use the search wiget but just clicking on the point does nothing.

I have noticed in the other operational layers that come with the viewer that the url references a FeatureServer whereas mine references a MapServer.

Could this be the problem and if so what is the difference between FeatureServer and MapServer?

When I publish my mxd it seems that the only choice I have is a MapServer.
0 Kudos
MikeHargreaves
Emerging Contributor
I believe that you should set the type in the operational layers to dynamic.  It is only a feature if you have set the layer to be editable, I believe.  If you put it to dynamic, then do not put the /0 at the end as was suggested earlier.
0 Kudos
NeilMillward
Regular Contributor
Hi Mike,

Tried your suggestion but the popup did not work. I was able to get it to work using the following code:

<layer label="Centerline Ties" type="Feature" visible="true" alpha="1"
                   info="widgets/InfoTemplates/SimpleInfoWinWidget.swf"
                   infoconfig="widgets/InfoTemplates/IWT_Centerline_Ties.xml"
                   url="http://gis.cityoforange.org/ArcGIS/rest/services/clTiePoints/MapServer/0"/>

The problem I have now is that in doing it this way loses the symbology that I had set in the mxd that was published. The other thing I needed in the popup is a link to a pdf document but this doesn't seem to work either.

I am new to this and appriciate any help.

Thanks
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Neil,

    The issue with the symbology not coming across is a limitation of not have the data coming from a ArcGIS 10 Server. If you are still using a 9.3.1 server than you will have to provide your own renderer info
here is a sample that demos that http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=Renderer. for the pdf link you will need a
<linkfield>your_pdf_complete_url_ field</linkfield>
in your /IWT_Centerline_Ties.xml file.
0 Kudos
NeilMillward
Regular Contributor
Hi Robert,

Thanks for the help.

In regard to the pdf documents, each point has a different document. I have a field named WEBSITE that contains the complete url to the document. eg: http://gis.cityoforange.org/GISData/Images/Centerline_Ties/CT-0239_MapleGrand.pdf

I am able to see this url in the popup but it is not clickable. Below is my IWT_Centerline_Ties.xml code.

<?xml version="1.0" ?>
<configuration>
    <fields>CT_NUM,LOCATION,WEBSITE</fields>
    <titlefield>CT_NUM</titlefield>
    <linkfield>WEBSITE</linkfield>
    <datefields></datefields> <!-- field in milliseconds -->
    <zoomscale>25000</zoomscale>
</configuration>

Thanks.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Neil,

   Looking at the code for the SimpleInfoWidget, there is a comment in it
TODO: Add support for link fields


So the bottom line is it won't work with the SimpleInfoWidget.

try switching to the widgets/InfoTemplates/InfoPopupWidget.swf
0 Kudos
NeilMillward
Regular Contributor
Robert,

I made the following change from SimpleInfoWinWiget in the config.xml file as you suggested.

           <layer label="Centerline Ties" type="Feature" visible="true" alpha="1"
                   info="widgets/InfoTemplates/InfoPopupWidget.swf"
                   infoconfig="widgets/InfoTemplates/IWT_Centerline_Ties.xml"
                   url="http://gis.cityoforange.org/ArcGIS/rest/services/clTiePoints/MapServer/0"/>

After making this change and clicking on the point I don't get any response.

Thanks.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Neil,

  OK studying the code tells me that won't work either as you figured out. So I guess hyperlinks are a no go until they get that finished in the SimpleInfoWidget.
0 Kudos
NeilMillward
Regular Contributor
Robert,

Thanks for your help.

You would think that to be able to link to a document or webpage from a field in the data would be a basic need when using the popup window.
0 Kudos