Zoom Scale

2130
6
Jump to solution
04-04-2013 12:57 PM
ShaningYu
Frequent Contributor
In ESRI's template, there are 20 levels on the Zoom Scale bar.  How can it be customized to the desired number of levels (e.g. 12)?  Thanks.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor
You have to manually set the LODs for the tiled map service. Here's an example on how to do that.

View solution in original post

0 Kudos
6 Replies
KenBuja
MVP Esteemed Contributor
You have to manually set the LODs for the tiled map service. Here's an example on how to do that.
0 Kudos
AnthonyGiles
Frequent Contributor
Shaning,

The number of levels on the zoom bar is set by the numbers of cache levels in the map service, you can use the lods tag to specify which ones you want to use:

http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#//01m300000018000000

You can get the resolution and scale by looking at the rest endpoint for the map service.

Regards

Anthony
0 Kudos
ShaningYu
Frequent Contributor
kenbuja:  Thanks for your response.  I added the customized code in the config like that below, but received ConfigManager error: A problem occurred while parsing the configuration file config.xml
Error #1083
Please point out what is wrong in my code below.  Thanks.

    <map >

        <esri:lods>
            <esri:LOD resolution="0.00000142768" scale="600"/>
            <esri:LOD resolution="0.00000285535" scale="1200"/>
            <esri:LOD resolution="0.00000571071" scale="2400"/>
            <esri:LOD resolution="0.0000114214" scale="4800"/>
            <esri:LOD resolution="0.0000228428" scale="9600"/>
            <esri:LOD resolution="0.0000456857" scale="19200"/>
            <esri:LOD resolution="0.0000913713" scale="38400"/>
            <esri:LOD resolution="0.000182743" scale="76800"/>
            <esri:LOD resolution="0.000365485" scale="153600"/>
            <esri:LOD resolution="0.00073097" scale="307200"/>
            <esri:LOD resolution="0.0.001461941" scale="614400"/>
        </esri:lods>
                <esri:extent>
            <esri:Extent xmin="-124.629" ymin="18.826" xmax="-68.027" ymax="56.311">
                <esri:SpatialReference wkid="4269"/>
            </esri:Extent>
        </esri:extent>

       
     <!--  wraparound180="true" initialextent="-14083000 3139000 -10879000 5458000"
     fullextent="-20000000 -20000000 20000000 20000000" top="40" addarcgisbasemaps="true"-->
        <operationallayers>
        </operationallayers>

    </map>
0 Kudos
AnthonyGiles
Frequent Contributor
Shaning,

Are you trying to put the code above in the config for the flex viewer? If you are it will not work the code is for using the flex API. If you want to use LODs in the viewer then use the following:

<map
        initialextent="-13046840 4036096 -13045400 4036867"
        fullextent="-16677000 2009000 -4819000 8330000"
        scale="1000000"
        wraparound180="true"
        top="40"
        addarcgisbasemaps="true">

    <lods><!-- only show a few levels -->
        <lod resolution="78271.5169639999" scale="295828763.795777"/>
        <lod resolution="9783.93962049996" scale="36978595.474472"/>
        <lod resolution="1222.99245256249" scale="4622324.434309"/>
        <lod resolution="152.874056570411" scale="577790.554289"/>
    </lods>
    ...
</map>

See here:

http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#//01m300000018000000

I think there may be confusion as you posted your question in the API for flex forum

Regards

Anthony
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Shaning,

  This is because you are posting in the Flex API forum and Ken is responding with the Correct response based on your question in the Flex API forum. I you would post to the Flex Viewer forum then you would get the correct response concerning how to do this in the Flex Viewer...

http://forums.arcgis.com/forums/111-ArcGIS-Viewer-for-Flex

Here is the link to the docs for the Flex Viewer main config.xml and then scroll down to find the section where it talks about lods.

http://resources.arcgis.com/en/help/flex-viewer/concepts/01m3/01m300000018000000.htm
0 Kudos
ShaningYu
Frequent Contributor
Sorry to post on a wrong forum.  I re-posted it on ArcGIS for Flexviewer session: http://forums.arcgis.com/threads/81503-Zomm-Scale-customization?p=287147#post287147.
0 Kudos