Select to view content in your preferred language

Adding Operational Layers

3673
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
NathanEnge
Esri Contributor
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



Looks like you have a minimum scale set on that map service. Try zooming in past that scale to see if it displays.
Also, check your spatial references. As far as I know, your map service should be in the same projection as whatever the BASE layers are...in this case Web Auxilury Sphere... Spatial Reference: 102100 (3857)
0 Kudos
by Anonymous User
Not applicable
Original User: Richmondgis

thanks for the assistance.  It turned out to be spatial reference as you suggested.

Im sure there will be many more questions over the next few months.

thanks again.

James
0 Kudos
MeganBirch
Regular Contributor
Specifying the rest endpoint solved the problem.  Thanks, Scott!
0 Kudos
by Anonymous User
Not applicable
Original User: anggita

Hi there, I have a same problems with operational layers that couldn't worked. I want to used a map  from my arcgis server but its seem the connection doesn't work at all, Even  I add the cross domain.xml on the root directory of inetpub/wwwroot on the arcgis server, still doesn't work. I'm stack!
BTW, I used a flex viewer 2.3.1, and below I included here a script from my apps :
Any help will be highly appreciated. Thanks.

<configuration>
    <title>  WebGIS Departemen Kehutanan</title>
    <logo>assets/images/dephut.png</logo>
   

    <style> 
        <colors>0xFFFFFF,0x333333,0x101010,0x000000,0xfae005</colors>
        <alpha>0.5</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="Txz2yC+nS1QVBMNnBbu4PBbxqImqFVSvKniqEMO/N2k"/>
   
<!-- UI elements -->   
    <splashpage label="ArcGIS Viewer for Flex" config="widgets/Splash/SplashWidget.xml" url="widgets/Splash/SplashWidget.swf"/>
    <widget bottom="-2" right="18" config="widgets/StaticImage/StaticImageWidget.xml" url="widgets/StaticImage/StaticImageWidget.swf"/>
    <widget right="15" top="55" config="widgets/MapSwitcher/MapSwitcherWidget.xml" url="widgets/MapSwitcher/MapSwitcherWidget.swf"/>
    <widget left="3" bottom="3" config="widgets/Coordinate/CoordinateWidget.xml" url="widgets/Coordinate/CoordinateWidget.swf"/>
    <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 wraparound180="true" initialextent="11888170 -692498 11889600 -691997" fullextent="10576749.573634 -1233050.6363851 15696049.8968022 661253.333416712" top="0" wkid="4021">
        <basemaps>
       <!--     <layer label="OpenStreetMap" type="osm" visible="true"/>
            <layer label="Aerial" type="tiled" visible="false"
                   url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"/>  -->
            <layer label="Aerial"  type="tiled" visible="true"
                   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="Kawasan Hutan" type="dynamic" visible="true" alpha="1.0"
                   url="http://webgis.dephut.go.id/ArcGIS/rest/services/KH/MapServer/0"/>
            <layer label="Pelepasan Kawasan Hutan" type="tiled" visible="true" alpha="1.0"
                   url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>                  
         <layer label="Pinjam Pakai Kawasan Hutan" type="tiled" visible="true" alpha="1.0"
                   url="http://webgis.dephut.go.id/ArcGIS/rest/services/PPKH/MapServer/0"/>
  <layer label="Pemanfaatan Kawasan Hutan" type="tiled" visible="true" alpha="1.0"
                   url="http://webgis.dephut.go.id/ArcGIS/rest/services/PKH/MapServer/0"/>
  <layer label="Penutupan Lahan" type="tiled" visible="true" alpha="1.0"
                   url="http://webgis.dephut.go.id/ArcGIS/rest/services/PL/MapServer/0"/>
  </operationallayers>
    </map>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Arief,

   Your issue is you are using layer type dynamic and tiled and then specifying a particular layer id in your url this is not allowed.

<operationallayers>
            <!--<layer label="Kawasan Hutan" type="dynamic" visible="true" alpha="1.0"
                   url="http://webgis.dephut.go.id/ArcGIS/rest/services/KH/MapServer/0"/>-->
<layer label="Kawasan Hutan" type="dynamic" visible="true" alpha="1.0"
                    url="http://webgis.dephut.go.id/ArcGIS/rest/services/KH/MapServer"/>
            <layer label="Pelepasan Kawasan Hutan" type="tiled" visible="true" alpha="1.0"
                    url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>                    
         <layer label="Pinjam Pakai Kawasan Hutan" type="tiled" visible="true" alpha="1.0"
                   url="http://webgis.dephut.go.id/ArcGIS/rest/services/PPKH/MapServer"/>
  <layer label="Pemanfaatan Kawasan Hutan" type="tiled" visible="true" alpha="1.0"
                   url="http://webgis.dephut.go.id/ArcGIS/rest/services/PKH/MapServer"/>
  <layer label="Penutupan Lahan" type="tiled" visible="true" alpha="1.0"
                   url="http://webgis.dephut.go.id/ArcGIS/rest/services/PL/MapServer"/>
  </operationallayers>
0 Kudos