{isZoomSlider: false} fails with default sliderStyle

1958
4
01-27-2013 10:35 AM
StephenLead
Regular Contributor III
Here's a minor bug introduced at 3.3. The new zoomSlider style is actually +/- buttons rather than a slider.

If you simply specify {isZoomSlider: false} the buttons are still shown. You need to specify {isZoomSlider: false, sliderStyle: "large" for the buttons to be removed.

It seems that if isZoomSlider is false, none of the zoom controls should be shown (eg, you don't want to allow zooming, or you're controlling it yourself).

Cheers,
Steve
0 Kudos
4 Replies
KellyHutchins
Esri Frequent Contributor
Instead of using the map property isZoomSlider you can use the map's constructor option of slider:

        map = new esri.Map("map", {
          slider:false,
          basemap: "streets",
          center: [-0.136, 51.510],
          zoom: 15
        });



Alternatively you can use the map's hideZoomSlider method to show/hide the slider after map creation:

        dojo.connect(map, "onLoad", function(){
            map.hideZoomSlider();
        });

0 Kudos
ScottSteigerwald
New Contributor III
Instead of using the map property isZoomSlider you can use the map's constructor option of slider:

Alternatively you can use the map's hideZoomSlider method to show/hide the slider after map creation:

        dojo.connect(map, "onLoad", function(){
            map.hideZoomSlider();
        });



This does not work.  The map still displays the zoom slider after the map is loaded, even with this code.  I'm assuming the order of events if overriding the behavior.  When is the zoom slider shown/added?  After all layers have been added?  What is the order of events?
0 Kudos
JonathanUihlein
Esri Regular Contributor
map.on("load", function(){map.hideZoomSlider();});


Works for me.

Sample here:

http://jsfiddle.net/WrQe4/
0 Kudos
ferferferf
New Contributor
But if you add sliderStyle: "large", to your code the slider is displayed and it shouldn`t, so it is a bug:

    
        map = new Map("mapDiv", {
        center: [-56.049, 38.485], //longitude, latitude
        zoom: 3,
        sliderStyle: "large",
        basemap: "streets",
        slider: true, //default
 sliderPosition: "top-left" //default
       
    });



map.on("load", function(){map.hideZoomSlider();});


Works for me.

Sample here:

http://jsfiddle.net/WrQe4/
0 Kudos