Select to view content in your preferred language

Help with config.xml

2292
16
10-22-2010 05:24 AM
JoshuaCoates
New Contributor
I have been working with Flexviewer for a few months now and have been slowly making progress creating a web app. I am having some minor issues that are rather annoying to try and conquer. I am going to try and keep this simple and straightforward in hopes that a few people can help guide me in the right direction. I have read the help pages and getting started resources, however, these do not exactly cover small steps that can be rather mundane but also confusing, or so I believe.

I have created 6 map services. I have the following: a basemap of the county, 2007 floodplain, 2007 cross sections, 2010 floodplain, 2010 cross sections, and a 2008 ortho of the county. All of these 6 services have been cached to optimize the browser speed for viewing.

I am trying to create a very simple application when users can zoom, pan, and perform simple address searches for the county. I have all the layers in each service setup with min/max in order to display at certain levels. I want to have this application have the basemap of the county to always be visible. All the other layers I want to have the ability to be turned on or off at the users choice. I would like to have all of the layers, including the basemap, to be visible in the layer list widget I implemented in case users want to turn layers on or off.

My troubles are a few: 1)The basemap layer is listed as my basemap layer and an operational layer, however it does not appear in the layer list. 2)I also have implemented the dynamic legend and for the basemap layers....they are all repeated twice in the dynamic layer once I am zoomed in to where all the layers in basemap are turned on?! 3) When I click on the arrow for a layer in the layer list, it drops down with the sublayers but there is no box to turn those sublayers on/off. (this may be due to the fact that all the services are cached and therefore cannot be turned on/off separately in the layer.

I am adding my config.xml for reference, if anyone can see something I may have set up wrong, please let me know....

<?xml version="1.0" ?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2010 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 mode about ArcGIS Viewer for Flex 2.1 - http://links.esri.com/flexviewer
//
////////////////////////////////////////////////////////////////////////////////
-->
<configuration>
    <title>Bartow County</title>
    <subtitle>Floodplain Mapping Application</subtitle>
    <logo>assets/images/bartow_courthouse.png</logo>
    <stylecolors>0xFFFFFF,0x333333,0x101010,0x000000,0xFFD700</stylecolors> <!-- Black Gold -->
    <stylealpha>0.8</stylealpha>

    <!-- 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="1991769 1448332 2191422 1642143">
        <basemaps>
         <layer label="Basemap" type="tiled" visible="true" alpha="1"
             url="http://publicgis/PublicGISserver/rest/services/Basemap/MapServer"/>   
        </basemaps>
        <operationallayers>
            <layer label="2008 Aerial Photo" type="tiled" visible="true" alpha="0.75"
                url="http://publicgis/PublicGISserver/rest/services/2008_Aerial_Photo/MapServer"/>
         <layer label="Basemap" type="tiled" visible="true" alpha="1"
             url="http://publicgis/PublicGISserver/rest/services/Basemap/MapServer"/>
            <layer label="2007 Cross Sections" type="tiled" visible="false" alpha="1"
                url="http://publicgis/PublicGISserver/rest/services/2007_CrossSections/MapServer"/>
            <layer label="2007 Bartow Floodplain" type="tiled" visible="false" alpha="1"
                url="http://publicgis/PublicGISserver/rest/services/2007_BartowFloodplain/MapServer"/>
            <layer label="2010 Cross Sections" type="tiled" visible="false" alpha="1"
                url="http://publicgis/PublicGISserver/rest/services/2010_CrossSections/MapServer"/>
            <layer label="2010 Bartow Floodplain" type="tiled" visible="true" alpha=".85"
                   url="http://publicgis/PublicGISserver/rest/services/2010_BartowFloodplain/MapServer"/>
          </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="Search" left="80" top="280"
                icon="assets/images/i_search.png"
                config="widgets/Search/SearchWidget_Bartow.xml"
                url="widgets/Search/SearchWidget.swf"/>
        <widget label="Layers" left="80" top="280"
          icon="assets/images/i_layers.png"
          config="widgets/LayerList/LayerListWidget.xml"
          url="widgets/LayerList/LayerListWidget.swf"/>
        <widget label="Dynamic Legend" left="25" top="565"
    icon="assets/images/i_legend2.png"
    config="widgets/DynamicLegend/DynamicLegendWidget.xml"
    url="widgets/DynamicLegend/DynamicLegendWidget.swf"/>
        <widget label="Print" left="390" top="400"
                icon="assets/images/i_print.png"
                config="widgets/Print/PrintWidget.xml"
                url="widgets/Print/PrintWidget.swf"/>

        <!--
        <widget label="My first widget"
                icon="assets/images/i_widget.png"
                config="widgets/Samples/HelloWorld/HelloWorldWidget.xml"
                url="widgets/Samples/HelloWorld/HelloWorldWidget.swf"/>
        -->
    </widgetcontainer>

</configuration>
Tags (2)
0 Kudos
16 Replies
JoshuaCoates
New Contributor
Anyone?? Anyone??
0 Kudos
ToddZimmerman
New Contributor III
Your base map shouldn't be listed under OperationalLayers. Each map service should only be in one place or the other, not both.
0 Kudos
MikeHargreaves
New Contributor III
I'm not sure what your cross section layers are, but they sound like they should be an operational layer.  My sight sounds somewhat similar.  I'm using aerials, elevation and hillshade as my base layer choices.  I've also added into the basemaps section a dummy layer that allows me not to have a basemap layer at all:

   <layer label="No Base" type="tiled" visible="true"  alpha="1"
                        url="http://agsmaps.ci.santa-rosa.ca.us//ArcGIS/rest/services/xxx/MapServer"/>

In addition, I have another layer that folks often add to the basemaps that has streets and boundaries and the like.  I've put that in the operationallayers section instead, that way it can be turned on, on top of a different basemap.  I do the same with labels.  I default the map to have no basemap, but I have the streets and labels turned on.  If you would like to check it out, here is a link:

http://agsmaps.ci.santa-rosa.ca.us/flexviewer/index.html
0 Kudos
MikeHargreaves
New Contributor III
Not sure why it cuts up the URL - but the work that was cut up is flexviewer. 

Also, can someone tell me how to insert code properly?  Thanks.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Mike,

   The forum condenses urls by default. the actually url is not changed but what is displayed is a condensed version. As far as code insert look at this attachment.
0 Kudos
JoshuaCoates
New Contributor
Mike, yes the cross sections are operational layers, I have them under the operational layers. I have all my streets, addresses, parcels, building footprints,etc in a map document called basemap. I also just added in an ESRI basemap service (streets) into that mxd and tried to re-cache it. It gave several errors about failing to create tiles at extent xxxxx.xxxxx. I was told that I could use any tiling scheme as long as there were close to the ESRI scale levels. I only want the ESRI map to be visible when you first get to the sight, once you zoom in once...I want it gone and only my "basemap" mxd layers showing. This is really only being done so that the map screen is not mostly white with only a county showing. I just think it looks bland and plain. So i am just trying to fill the screen with background reference data around the county itself. It would also be nice to have the shade and color from the ESRI service instead of just my plain white county with a few highways and cities labeled, which also look dull to me. I am trying to re-cache my basemap mxd again at the one level I need displayed, hope this works. Thanks for all the input!

Josh C.
0 Kudos
MikeHargreaves
New Contributor III
Robert - thanks for the tips.

Josh,

Not sure what is causing the cache to fail, though your idea of only caching individual scales should help you identify what is causing the problem.  If you bring a different service into the mxd, and that service is in a different projection, it could be that the system is timing out, since it takes awhile for the tiles to be reprojected.  If the scales are different, then ArcMap will take the nearest scale to what your map is in, and then zoom in or out depending.  This can cause it to look blurred somewhat, which is why the earlier comment about wanting the scales to be similar.  I have another map that you might want to look at:  http://pmaps.ci.santa-rosa.ca.us/geocortex/essentials/web/viewer.aspx?site=County  It is not a flexviewer app, but it is one I did of our county, and it contains surrounding county boundary and road info that is available in your ESRI data disks.  It might not look as snazzy as the online service, but it would be another way to go.
0 Kudos
JoshuaCoates
New Contributor
Ok maybe this will work.....can someone chime in if they know best way to do this.....

Can I put the ESRI map serivice as my basemap and set it up to show at my initial extent of my county? And then have it set up to where it turns off at another extent? This way I could use my basemap as an operational layer and everything would work fine?! I just cannot figure out what units the <map initialextent> uses?!

Josh C.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Josh,

   Are you ready to jump into some real coding? That's what this will take You will have to modify the MapManager.mxml to turn on and off the esri basemap using an event listener for extent changed. As far as the units ESRI's basemaps (the newer ones that the viewer uses) are in webmercator WKID:102100. There has been several discussions of this in the old forum.

http://forums.esri.com/Thread.asp?c=158&f=2421&t=295797&mc=12#msgid923366
0 Kudos