AnsweredAssumed Answered

Map div resizing

Question asked by samirgambhir on Feb 22, 2012
Latest reply on May 25, 2012 by samirgambhir
Hello,
May application has a TabContainer with two tabs with a map div in each. The first tab has a map with width 100% and height 100%. I would like to define the map div in the second tab with a different width and height. I have tried using resize function to get this map div to conform to my width and height requirement but it does not work. Can somebody help? The codes are as:

In Html
<div id="projectTabContainer" dojoType="dijit.layout.TabContainer" style="width: inherit; height: 900px;">
      <div id="mappingTab" dojoType="dijit.layout.ContentPane" title="Mapping">
        <div id="mapM" dojotype="dijit.layout.ContentPane" region="center"></div>
</div>
<div id="analysisTab" dojoType="dijit.layout.ContentPane" title="Analysis" >
        <div id="mapA" dojotype="dijit.layout.ContentPane" ></div>
</div>

In css
html, body {
  height: 100%; width:100%; margin:0; padding:0;
}
body {
  background-color: #F0F0F0; overflow: hidden; font-family: "Calibri";
}
#mapM {
position:absolute; width:100%; height:99%; padding:0;
}
#mapA {
  position:absolute; width: 800px; height: 300px; right:10px; top:10px; box-shadow:1px 1px 10px black;
}

In code
mapM = new esri.Map("mapM", {extent : iniExtentM});
        mapA = new esri.Map("mapA", {slider: false, nav:false, extent : iniExtentA});
           
        StreetMapM = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
        StreetMapA = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
        mapM.addLayer(StreetMapM);
        mapA.addLayer(StreetMapA);
        StreetMapA.setOpacity(0.60);
        StreetMapM.setOpacity(0.60);

Thanks
Samir

Outcomes