Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am using ArcGIS API for flex 2.4 with ArcGIS server 10. I am trying to write the widget where user can define the map scale (type it in text box) and it will zoom to that scale. I successfully created a widget. But When I type scale in the text box it still zooms to the nearest LOD scale level. e.g. if i zoom to 5000 scale, it will take it as 4,514.

Could anyone suggest what change I need to make? Is there anything that needs to be defined in MapManager?

<?xml version="1.0" encoding="utf-8"?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
// 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
//
////////////////////////////////////////////////////////////////////////////////
-->
<viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   xmlns:esri="http://www.esri.com/2008/ags"
                   xmlns:viewer="com.esri.viewer.*"
                   widgetConfigLoaded="init()">
    <fx:Script>
        <![CDATA[
            //this function called when the widget's configuration is loaded
            private function init():void
            {
                if (configXML) // checking for valid content in the configuration file
                {

                }

                mapScaleObj.text = String(map.scale);           
            }

            private function doScale():void
            {
                map.scale = Number(mapScaleObj.text);
                mapScaleObj.text = String(mapScaleObj.text);
            }
        ]]>
    </fx:Script>
    <viewer:WidgetTemplate id="helloWorld"
                           width="250" height="110">
        <viewer:layout>
            <s:VerticalLayout horizontalAlign="center" verticalAlign="middle"/>
        </viewer:layout>
        <s:SkinnableContainer >
            <s:HGroup>
                <s:Label height="100%" color="#FFFFFF" fontSize="14" fontWeight="bold" text="Scale 1:"
                         verticalAlign="middle"/>
                <s:TextInput id="mapScaleObj"   text="{map.scale}"           
                             restrict="0-9"
                             enter="doScale();"
                             />
            </s:HGroup> 
        </s:SkinnableContainer>     
    </viewer:WidgetTemplate>
</viewer:BaseWidget>
share|improve this question
1  
Is this a cached or dynamic map? –  Michael Todd Aug 16 '11 at 20:03
3  
As Michael Todd is getting at, if the Map Service is cached, or if the map contains any cached Map Services, your scale levels are limited to the scale levels specified in the tiling scheme of the cached Map Service. If this is the case, you can only zoom to those scales. –  Gady Aug 16 '11 at 23:02
    
I am having the same problem. I am using a base map but using the layer as dynamic and the steps do not appears on the navigator. Have you any progress on it? Regards –  Zeca Mar 20 at 14:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.