Select to view content in your preferred language

Viewing ArcGIS.com maps with a flex viewer

2586
21
12-01-2011 01:30 AM
JonBall
Deactivated User
Hi

I am new to ArcGIS online and to Flex and am trying to create a map that I can then view through an ArcGIS Viewer for Flex. I have made some progress but cannot find a way to gain the full benefits of the Flex Viewer for my ArcGIS.com map. For instance I would like to use the search widget to find features on the map.

My ArcGIS.com map consists of 2 baselayers and a shapefile layer of 45 points. I wish to be able to interogate this layer in the Flexviewer, but I cannot find a method that will allow me to specify my points layer as an operational layer in the flex viewer, so I cannot quite get my hands on a lot of the functionality that I was looking for. (The only way I could access my ArcGIS online content was by using "itemid=" in the <map> tag, which seems to disable all baselayers and operational layers in the flex map).

Does anyone know of a way to achieve this?

Thanks for reading!

Jon B
Wildlife Research Technician
Tags (2)
0 Kudos
21 Replies
RobertScheitlin__GISP
MVP Emeritus
Veronica,

   You have to setup your own popup configuratione file. Here is what you will need:

Create a PopUp_Voting.xml file in the popups folder in your Flex Viewer

<?xml version="1.0" ?>
<configuration>
    <title>{VOTING_LOC}</title>
    <fields>
        <field name="PRECINCT" alias="Precinct" visible="true"/>
        <field name="VOTING_LOC" />
        <field name="ADDRESS" alias="Address" visible="true"/>
    </fields>
    <showattachments>false</showattachments>
</configuration>

<!--
    Pop-up configuration file for:
    http://services.arcgis.com/4B9WU9185SohZnyi/ArcGIS/rest/services/City_voting_locations/FeatureServer/0

    See pop-up documentation at
    http://links.esri.com/flexviewer/popups
-->


and add the popoupconfig attribute to the main config.xml like this:

<layer label="City_voting_locations" type="feature" visible="true" alpha="1" popupconfig="popups/PopUp_Voting.xml" 
                   url="http://services.arcgis.com/4B9WU9185SohZnyi/ArcGIS/rest/services/City_voting_locations/FeatureServer/0"/>
0 Kudos
DasaPaddock
Esri Regular Contributor
Veronica,

Another option is to use the web map as authored on arcgis.com. To do this, you would just set the map tag like this:

<map itemid="c4670a647b2f42e3b6818edc7cb485cd">
</map>
0 Kudos
VeronicaMoore1
Emerging Contributor
Thank you so much for all your help. But I still can get the pop ups to work.
Any other ideas? Or maybe that option is not available with the feature service I have in my arcgisonline.com subscription.
I have the beta trial so I'm not quite sure.


Veronica,

   You have to setup your own popup configuratione file. Here is what you will need:

Create a PopUp_Voting.xml file in the popups folder in your Flex Viewer

<?xml version="1.0" ?>
<configuration>
    <title>{VOTING_LOC}</title>
    <fields>
        <field name="PRECINCT" alias="Precinct" visible="true"/>
        <field name="VOTING_LOC" />
        <field name="ADDRESS" alias="Address" visible="true"/>
    </fields>
    <showattachments>false</showattachments>
</configuration>

<!--
    Pop-up configuration file for:
    http://services.arcgis.com/4B9WU9185SohZnyi/ArcGIS/rest/services/City_voting_locations/FeatureServer/0

    See pop-up documentation at
    http://links.esri.com/flexviewer/popups
-->


and add the popoupconfig attribute to the main config.xml like this:

<layer label="City_voting_locations" type="feature" visible="true" alpha="1" popupconfig="popups/PopUp_Voting.xml" 
                   url="http://services.arcgis.com/4B9WU9185SohZnyi/ArcGIS/rest/services/City_voting_locations/FeatureServer/0"/>
0 Kudos
VeronicaMoore1
Emerging Contributor
I did and i got error #1085 (problem ocurred while parsing the configuration file config.xml)


Veronica,

Another option is to use the web map as authored on arcgis.com. To do this, you would just set the map tag like this:

<map itemid="c4670a647b2f42e3b6818edc7cb485cd">
</map>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Veronica,

   As your data is public I used your data and got the popup to work with what I sent you. You need to double check your sets and see if you missed something.
0 Kudos
VeronicaMoore1
Emerging Contributor
For some reason it wasn't refreshing and when I open the site with firefox it worked. From now on I'm going to use firefox instead of IE.
I'm new at this and trying to get all the help I can get.

Thank you so much! You are a life saver.


Veronica,

   As your data is public I used your data and got the popup to work with what I sent you. You need to double check your sets and see if you missed something.
0 Kudos
VeronicaMoore1
Emerging Contributor
Now, that I have the layers working with the pop-ups is there any way to change the symbology of those layers?
Right now, they look like plain red dots.
Thank you,
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Veronica,

Sure you can change the symbology in the portal web map and re-publish. The other way would involve changing code in the Flex Viewer source.
0 Kudos
VeronicaMoore1
Emerging Contributor
[ATTACH=CONFIG]15530[/ATTACH]
I don't see any editing capabilities when I tried to change the symbology in the feature service that I have in the arcgis.com account. Am I missing something?
Veronica,

Sure you can change the symbology in the portal web map and re-publish. The other way would involve changing code in the Flex Viewer source.
0 Kudos