Select to view content in your preferred language

Adding Operational Layers

3660
24
06-10-2011 07:25 AM
JamesArmstrong
Occasional Contributor
ArcGIS 9.3.1
ArcServer 9.3.1
Flexviewer 2.3.1
Status: newbie

I have downloaded the flexviewer and got it running on my ArcServer using the default config.xml file. I have changed the initial extent as well as added a wkid= 2264 (North Carolina) to the intitialextent line.  The site seems to work fine.

Then I add my own operational layer (from my server)- and I get an error and the site will not load.  If this layer is commeted out, the site again works fine.  Spent last few days researching ans trying different things.  I have learned alot, but not how to solve this issue.  Any suggestion or points in the right direction will be greatly appreciated.  Below is the <map> portion of my config file and I have attached the screen shot of the received error.  The site is still in test mode and not open to general internet.

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

<map initialextent="-9024000 4121000 -8800000 4222000" top="40" wkid="2264">
        <basemaps>
            <layer label="Streets" type="tiled" visible="true"
                   url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
            <layer label="Aerial"  type="tiled" visible="false"
                   url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"/>
            <layer label="Topo"    type="tiled" visible="false"
                   url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>
        </basemaps>
        <operationallayers>
            <layer label="Demographics" type="tiled" visible="false" alpha="0.5"
                   url="http://server.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Median_Household_Income/MapServ...">
                <sublayer id="1" popupconfig="popups/PopUp_Demographics_BlockGroups.xml"/>
                <sublayer id="2" popupconfig="popups/PopUp_Demographics_Tracts.xml"/>  
                <sublayer id="3" popupconfig="popups/PopUp_Demographics_Counties.xml"/>
                <sublayer id="4" popupconfig="popups/PopUp_Demographics_States.xml"/> 
            </layer>
            <layer label="Parcels" type="feature" visible="false" alpha="1.0"
                   url="http://gis.richmondnc.com/ArcGIS/rest/services/RichmondMXD/RichmondAddTest/MapServer/5"/> 
            </layer>                 
        </operationallayers>
    </map>
0 Kudos
24 Replies
AnthonyPagan
Occasional Contributor
I am haveing the same problem I am running ArcServer 10, ArcGIS 10, Flexviewer 2.3.1, Adobe Flash Builder 4. I downloadeed and did everything the Getting started instructions say to do for the uncompiled version of the viewer I got all my widgets to work but when I add an operational layer it shows up in the more tab of the map switcher but does not display here is my code:

     <operationallayers>     
         <layer label="Parcels" type="dynamic" visible="false" alpha="1.0"                 
                   url="http://gisserver/HHGIS/rest/services/HH_GIS/MapServer/46"/>              
     </operationallayers>

After I add code to the flex project I save and build the project then go to run index.mxml and it comes up in a IE window and everything displays except my parcel layer. Any sugestions
0 Kudos
by Anonymous User
Not applicable
Original User: djustice1130

If anyone gets this figured out please let us know.  I've tried just about everything I know to do and the listed suggestions and am still having the same problem.
0 Kudos
AnthonyPagan
Occasional Contributor
I have added a crossdomain.xml and a clientaccesspolicy.xml and I still can't get this to work.
0 Kudos
by Anonymous User
Not applicable
Original User: djustice1130

Here's my current layer that I'm trying to get setup.

<layer label="CN Jurisdiction" type="dynamic" visible="true"
         url="http://geodata.cherokee.org/ArcGIS/rest/services/Maps/CNBoundary/MapServer/0"/>

If you look at the service I can get it to show up as a JavaScript or ArcGIS.com map but can't seem to get it to show up in my flexviewer (http://geodata.cherokee.org/flexviewer).  I'm not a programmer but I think I've got it entered right, just not sure where to go from here.  Any ideas?
0 Kudos
NathanEnge
Esri Contributor
I am haveing the same problem I am running ArcServer 10, ArcGIS 10, Flexviewer 2.3.1, Adobe Flash Builder 4. I downloadeed and did everything the Getting started instructions say to do for the uncompiled version of the viewer I got all my widgets to work but when I add an operational layer it shows up in the more tab of the map switcher but does not display here is my code:

<operationallayers>
<layer label="Parcels" type="dynamic" visible="false" alpha="1.0"
url="http://gisserver/HHGIS/rest/services/HH_GIS/MapServer/46"/>
</operationallayers>

After I add code to the flex project I save and build the project then go to run index.mxml and it comes up in a IE window and everything displays except my parcel layer. Any sugestions


as far as I know, type="dynamic" does not allow you to specifically show a single layer from the map service. try removing /46/. If you want to specficially only show one layer. I think you need to use type="feature"

Here's my current layer that I'm trying to get setup.

<layer label="CN Jurisdiction" type="dynamic" visible="true"
url="http://geodata.cherokee.org/ArcGIS/rest/services/Maps/CNBoundary/MapServer/0"/>

If you look at the service I can get it to show up as a JavaScript or ArcGIS.com map but can't seem to get it to show up in my flexviewer (http://geodata.cherokee.org/flexviewer). I'm not a programmer but I think I've got it entered right, just not sure where to go from here. Any ideas?


Same with you, try removing the /0


The end of the URL should not have a / in it.

Unfortunately there is no way to exclude layers from a map service, only displaying visible on/off at startup. Use this: visiblelayers="0,1,2,6,7,8,9,10,11,12" where number = id of layer.
0 Kudos
by Anonymous User
Not applicable
Original User: djustice1130

That worked!  I could have swore I tried that before but I've tried so many different things maybe I didn't.  Good news is, it works now.
0 Kudos
JamesArmstrong
Occasional Contributor
A lot of great posts to this thread, thank you.  However, I am still having trouble seeing the "parcel" layer on flexviewer.  The layer loads and is shown in the TOC.  I can turn the layer off ans on, but the data does not show.  The layer is saved with a compound symbol, but I checked this off by using another layer with a simple line symbol.

Any ideas as to why I cannot see the daat in the layer I am adding as an operational layer?

I have attached a copy of my code below:

<?xml version="1.0" ?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2010-2011 ESRI
//
// All rights reserved under the copyright laws of the United States.
// You may freely redistribute and use this software, with or
// without modification, provided you include the original copyright
// and use restrictions.  See use restrictions in the file:
// <install location>/License.txt
//
// Read more about ArcGIS Viewer for Flex 2.3 - http://links.esri.com/flexviewer
//
////////////////////////////////////////////////////////////////////////////////
-->
<configuration>
    <title>Richmond County North Carolina</title>
    <subtitle>a test of the ArcGIS Flex Viewer</subtitle>
    <logo>assets/pictures/RichmondSeal1.png</logo>
    <style>
        <colors>0xFFFFFF,0x333333,0x101010,0x000000,0xFFD700</colors>
        <alpha>0.8</alpha>
    </style>
    <!-- replace the following url with your own geometryservice -->
    <geometryservice url="http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer" />
    <!-- replace the following key with your own Bing key -->
    <bing key="Ahw1due6dkmZg98wUJJYLrVmYlDik4oleCg6hoNqx6l2jFYRToImQH1HfH-asjjH"/>

<splashpage label="ArcGIS Viewer for Flex" config="widgets/Splash/SplashWidget.xml" url="widgets/Splash/SplashWidget.swf"/>

    <!-- UI elements -->
    <widget left="10"  top="50"    config="widgets/Navigation/NavigationWidget.xml" url="widgets/Navigation/NavigationWidget.swf"/>
    <widget right="-2" bottom="-2" config="widgets/OverviewMap/OverviewMapWidget.xml" url="widgets/OverviewMap/OverviewMapWidget.swf"/>
    <widget right="20" top="55"    config="widgets/MapSwitcher/MapSwitcherWidget.xml" url="widgets/MapSwitcher/MapSwitcherWidget.swf"/>
    <widget left="0"   top="0"     config="widgets/HeaderController/HeaderControllerWidget.xml" url="widgets/HeaderController/HeaderControllerWidget.swf"/>

   <map initialextent="-9024000 4121000 -8800000 4222000" top="40" wkid="2264">
        <basemaps>
            <layer label="Streets" type="tiled" visible="true"
                   url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
            <layer label="Aerial"  type="tiled" visible="false"
                   url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"/>
            <layer label="Topo"    type="tiled" visible="false"
                   url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>
        </basemaps>
        <operationallayers>
            <layer label="Demographics" type="tiled" visible="false" alpha="0.5"
                   url="http://server.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Median_Household_Income/MapServ...">
                <sublayer id="1" popupconfig="popups/PopUp_Demographics_BlockGroups.xml"/>
                <sublayer id="2" popupconfig="popups/PopUp_Demographics_Tracts.xml"/>  
                <sublayer id="3" popupconfig="popups/PopUp_Demographics_Counties.xml"/>
                <sublayer id="4" popupconfig="popups/PopUp_Demographics_States.xml"/> 
            </layer>
            <layer label="Parcels" type="feature" visible="false" alpha="1.0"
                   url="http://gis.richmondnc.com/ArcGIS/rest/services/RichmondMXD/RichmondAddTest/MapServer/5"> 
            </layer>                 
        </operationallayers>
    </map>

    <!-- widgets organized into widget containers that manage close/open etc -->
    <!-- supported layout property options: horizontal(default)|float|vertical|fix-->
    <widgetcontainer layout="float">
        <widget label="Bookmarks"         left="430" top="90"
                icon="assets/images/i_bookmark.png"
                config="widgets/Bookmark/BookmarkWidget.xml"
                url="widgets/Bookmark/BookmarkWidget.swf"/>
        <widget label="Find an address"   left="100" top="90" preload="open"
                icon="assets/images/i_target.png"
                config="widgets/Locate/LocateWidget_Bing.xml"
                url="widgets/Locate/LocateWidget.swf"/>
        <widget label="Earthquakes (GeoRSS)" left="410" top="280"
                icon="assets/images/i_rss.png"
                config="widgets/GeoRSS/GeoRSSWidget.xml"
                url="widgets/GeoRSS/GeoRSSWidget.swf"/>
        <widget label="Draw and Measure" left="60" top="400"
                icon="assets/images/i_draw2.png"
                config="widgets/Draw/DrawWidget.xml"
                url="widgets/Draw/DrawWidget.swf"/>
        <widget label="Print" left="390" top="400"
                icon="assets/images/i_print.png"
                config="widgets/Print/PrintWidget.xml"
                url="widgets/Print/PrintWidget.swf"/>
        
        
     </widgetcontainer>

</configuration>

======================

thanks

James
0 Kudos
by Anonymous User
Not applicable
Original User: rscheitlin

James,

  You need to add the mode and useamf attributes to your layer element

<layer label="Parcels" type="feature" visible="false" alpha="1.0" mode="snapshot" useamf="false"
                   url="http://gis.richmondnc.com/ArcGIS/rest/services/RichmondMXD/RichmondAddTest/MapServer/5">  
            </layer>                  
0 Kudos
NathanEnge
Esri Contributor
That worked! I could have swore I tried that before but I've tried so many different things maybe I didn't. Good news is, it works now.


I find that clearing internet cache on the client, flash cache on the client, and rest cache on the server helps. Also, closing the browser down, and then reopen.
simply hitting the refresh button doesn't seem to 'refresh' the map services.
0 Kudos
by Anonymous User
Not applicable
Original User: Richmondgis

James,

  You need to add the mode and useamf attributes to your layer element

<layer label="Parcels" type="feature" visible="false" alpha="1.0" mode="snapshot" useamf="false"
                   url="http://gis.richmondnc.com/ArcGIS/rest/services/RichmondMXD/RichmondAddTest/MapServer/5">  
            </layer>                  



Thanks, but this did not seem to work.  I have tried to use other layers in the service as well as change from feature to dynamic (also changing the url as appropriate).  the layer shows up in the TOC but no data is shown.  I am sure it very basic, but something that I have not yet been able to find.  I can not move forward until this is solved, so any suggestion or advice will be appreciated.

James
0 Kudos