html, body { width:100%; height:100%; } #leftPane { width:20% } #mapDiv { padding:0; overflow: hidden; }
dijit.byId('borderContainer').resize();
<!--------create main map---------------------------------------------------> var mainMap = new Map("mapDiv", { basemap : "topo", center : [-118.161, 33.8045], zoom : 10, sliderStyle: "small", }); dijit.byId('borderContainer').resize(); }); <!---------
require([ "dijit/layout/BorderContainer", "dijit/layout/TabContainer", "dijit/layout/ContentPane", "esri/map", "dijit/registry", "dojo/on", "dojo/dom", "dojo/dom-class", "dojo/dom-construct", "dojo/domReady!"], function( BorderContainer, TabContainer, ContentPane, Map, registry, dom, domClass, domConstruct) { <!--------create main map---------------------------------------------------> var mainMap = new Map("mapDiv", { basemap : "topo", center : [-118.161, 33.8045], zoom : 10, sliderStyle: "small", }); var borderCont = registry.byId("borderContainer"); borderCont.resize(); }); <!---------------------------------------------------------------------------->
<link rel="stylesheet" href="http://js.arcgis.com/3.7/js/dojo/dijit/themes/tundra/tundra.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.7/js/esri/css/esri.css"> <link rel="stylesheet" href="css/layout.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.7/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.7/js/esri/css/esri.css"> <link rel="stylesheet" href="css/layout.css">
Was this question ever answered? I am having the same issue and can't figure it out. The Powered by Esri logo doesn't appear and I am having a cursor offset issue when my map loads. If I resize the window, everything is fixed and it works great. is there some kind of map.reposition function I need to run or something like that?
This is the code that has been recommended to use in other posts
map.on("load", function () {
registry.byId("divMap").on("resize", function () {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function () {
map.resize();
map.reposition();
}, 500);
});
});