Select to view content in your preferred language

Positioning zoom slider

4732
2
Jump to solution
05-25-2012 10:11 AM
SamirGambhir
Frequent Contributor
Hello,
I have two tabs in my application and both tabs have map divs in it. The scale and position of each map is different. I would like to have different placement for zoom slider in each tab. I am trying to use esri.config.defaults.map.slider in the following way:

function onSelectChild(page) {
      switch(page.id){
        case 'mappingTab':
          mapM = new esri.Map("mapM", {extent : iniExtentM});
          StreetMapM = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
          StreetMapM.setOpacity(0.60);
          mapM.addLayer(StreetMapM);
          esri.config.defaults.map.slider = {position:"absolute",left:"225px", top:"30px", height:"200px", zindex:"30"};
          break;
        case 'analysisTab':
          mapA = new esri.Map("mapA", {extent : iniExtentA});
          StreetMapA = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
          StreetMapA.setOpacity(0.60);
          mapA.addLayer(StreetMapA);
          esri.config.defaults.map.slider = {position:"absolute",right:"30px", top:"30px", height:"200px", zindex:"30"};
          break;
      }
    }

but since this is the default slider, any changes impact sliders on both tabs in the same way. Does anyone know a way to do this?
Thanks
Samir Gambhir
0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor
You can do this by modifying the css for each map's slider individually. Here's a sample that shows this:

http://jsfiddle.net/JJHKR/

View solution in original post

0 Kudos
2 Replies
KellyHutchins
Esri Frequent Contributor
You can do this by modifying the css for each map's slider individually. Here's a sample that shows this:

http://jsfiddle.net/JJHKR/
0 Kudos
SamirGambhir
Frequent Contributor
It worked! Thanks Kelly,
Samir
0 Kudos