Select to view content in your preferred language

Can you disable only the Zoom Slider in Viewer?

1255
4
03-08-2011 12:02 PM
DougZeliff
Emerging Contributor
I have read how to disable the navigation widget completely and how to hide individual components of the widget, but I have searched the forums to no avail on how to hide the zoom slider while having zoom out and pan available.

I am using the GeoRss widget to diplay locations of endangered species sightings and I want to limit the ability to zoom completely in to see precise locations in the Flex Viewer window. I allow the zoom on the GeoRSS widget, but do not want people to zoom beyond the extent I specify in that widget. I still want some navigation elements such as the pan tools, zoom out, and extent tools available, just not Zoom in and the Zoom Slider.
Tags (2)
0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Doug,

You will have to edit the source code in the Navigation Widget. Specifically the Navigation.mxml

Find this code and make the indicated change:

<esri:Navigation top="0" visible="false" includeInLayout="false"
                     map="{map}"
                     skinClass="widgets.Navigation.NavigationSkin"/>


Disabling the zoom in button is as simple as setting the zoominbutton visible attribute to false in the NavigationWidget.xml
0 Kudos
DougZeliff
Emerging Contributor
Thanks Robert. I am brand new to Flash Builder so I will attempt the change you gave me. I knew about the removal of the Zoom in button, but found it odd that the Zoom Slider appeared to be the only component of the navigation widget that could not be removed.

On a side note, is it posssible to control the visible extent for ESRI base maps used in the Flex Viewer. This would be an alternative to removing the slider. If I could make the base maps unavailble beyond a certain zoom scale, I could achieve the same goal.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Doug,

   You can remove Levels of Display (LODs) from the map and that would accomplish what you are after.

you could change to this code in your MapManager.mxml
//map load complete
            private function mapLoadComplete(event:MapEvent):void
            {
                // ViewerContainer.dispatchEvent(new AppEvent(AppEvent.LAYER_LOADED));
    //Remove the last LOD (the closest zoom level)
                                map.lods.pop();
                                //or remove the last 5 LODs
                                map.lods.splice(map.lods.length -5, 5);
            }
0 Kudos
DougZeliff
Emerging Contributor
Thanks again Robert. I was able to remove the slider from the Navigation widget. I appreciate your help.
0 Kudos