Hide Zoom slider

4370
1
01-20-2012 07:38 AM
deleted-user-K_IRAXrpGKsG
New Contributor III
Hello,

I have a very simple question. How do I hide the zoom slider?

//creating the map and giving its extent
  map = new esri.Map("mapDiv", {
          extent: new esri.geometry.Extent({
            xmin: -8493917.422371,
            ymin: -103006.213374596,
            xmax: -13493917.422371,
            ymax: 9260250.68904796,
            spatialReference: {
              wkid: 102100
            }
          }),
  //calling the lods array above. This tells the map which views to use
  lods: lods
        });
  
  map.hideZoomSlider();


what's wrong with this code?

Thanks!
0 Kudos
1 Reply
KellyHutchins
Esri Frequent Contributor
You have to wait until after the map is loaded:

var map = ...;
dojo.connect(map, "onLoad", function() {
  map.disablePan();
});


Alternatively you can disable the slider when you create the map by setting the slider option to false:

 map = new esri.Map("map",{
 extent:esri.geometry.geographicToWebMercator(initExtent),
 slider:false
 });
0 Kudos