Select to view content in your preferred language

Help with config.xml

2297
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
Well this is a complete bummer. I do not think I could handle the coding. I just cant figure out why I can not cache my basemap with the ESRI layer added?? It makes no sense?!
0 Kudos
MikeHargreaves
New Contributor III
Josh,

Did you try doing it with just the online service to see if you could cache that?  I tried it, putting it into a different coordinate system and it worked fine.  A couple of questions - did you set up a full extent in your mxd?  If not, you are probably attempting to cache the whole world...  Were you able to cache any scales?  What format (jpg, png8, etc) were you caching in?  How good is your internet connection?
0 Kudos
JoshuaCoates
New Contributor
Ok here we go, this is sounding better. I may have just not performed the task correctly. I need to have it projected to match my basemap, in State Plane. I can do this....now, how do I set up the full extent and where do I do this? When I treid caching, I only tried to cache at 1:200,000 and at 1:128,000. Which are the first two levels of display on my basemap that I want the ESRI service visible for. No levels cached at all so that leads me to think I may have been trying to cache the entire world as you mentioned.

I am trying to cached in the exploded format, png24. And our internet and intranet connections are great.
0 Kudos
MikeHargreaves
New Contributor III
A couple of things first.  Why are you choosing PNG24?  If you are using something that has hill shading, then you probably won't be needing to have transparancy.  Aerials and other raster based layers are best to do in JPG with a compression of 60 and a tile size of 256.  Your goal here is to minimize the size of your downloads to the user, and PNG24 produces large file size, and takes longer to cache.  If you are doing something where you need transparency, then I would try to do it in PNG8 since that will also keep file size down.  The only time you would want to use PNG24 is when you are using anti-aliasing, which causes the number of colors to exceed what PNG8 can handle.  Personally, I just use PNG8 for vector services, and JPG for rasters.  Next, I'm curious why you have scales of 128,000 and 200,000, since normally you want to double the scale each time, though if 200,000 is good enough to cover your area, then I guess that could make sense...

So, to your question of caching only a portion.  You can do this in a couple of ways.  In ArcMap, the easiest way is to first set the visible extent to what you want it to be, and then right-click on Layers in the TOC and select properties.  In the Data Frame tab click Other and then Specify Extent.  Once there, click on Current Visible Extent.  You could also explicitly set your extent if you know it.  Also, while you're here, make sure the Coordinate System is correct.  The other way to do only cache a portion is to do it when you are actually doing the caching.  At the bottom of the Manage Map Server Cache Tiles dialog, you have the ability to "Update specific areas using a feature class" where you can supply a rectangular feature class that covers your area.  I would choose the first way myself...
0 Kudos
JoshuaCoates
New Contributor
So is the world street map considered raster or vector? It seems to have both types of data in the layer??? What would be best to cache this as if I just need the two scales I mentioned? Thanks for your help btw!
0 Kudos
MikeHargreaves
New Contributor III
Josh,

ESRI_StreetMap_World_2D is a combination both raster and vector layers, as you say, but once you use a raster layer, then you want to use JPG.  Generally, if you want to create a service that you can put above another service and be able to see the service below where there is no data in the service above, you would want transparancy, and that requires PNG.  JPG is for services that will be at the bottom of your stack, and will serve as your "base."  Personnally, I wanted my users to have the choice of whether they wanted my streets service by itself, or to be put ontop of other base layers like hillshade or aerials, so I made the service PNG8 with the white areas transparent.  Other folks like the look and simplicity of the ESRI service.  Is the data that you are trying to mix with this layer only vector?  Feel free to call me if you want, it might go quicker that way, especially since we are getting off topic for this forum I think.  707-543-3112
0 Kudos
JoshuaCoates
New Contributor
I tried calling. If you can, feel free to call me back when you get a chance. 770-833-0013
0 Kudos