AnsweredAssumed Answered

Help with Creating a map on top of Esri's Basemap Gallery

Question asked by rglafleur on Mar 30, 2016
Latest reply on Apr 4, 2016 by MidnightYell2003

I need help getting the following map/code to show up, but have the map gallery as the basemap.

My code

arcgisUtils.createMap("511bd0e84f1441edb7bf55167ecddec2", "map").then(function (response) {

              //update the app

              dom.byId("title").innerHTML = response.itemInfo.item.title;

              dom.byId("subtitle").innerHTML = response.itemInfo.item.snippet;


              map =;

              //add the scalebar

              scalebar = new Scalebar({

                map: map,

                scalebarUnit: "english"


              overviewMapDijit = new OverviewMap({

                map: map,

                visible: true




              //add the legend. Note that we use the utility method getLegendLayers to get

              //the layers to display in the legend from the createMap response.

              var legendLayers = arcgisUtils.getLegendLayers(response);

              legendDijit = new Legend({

                map: map,

                layerInfos: legendLayers

              }, "legend");




the Map gallery

<!DOCTYPE html>



  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">


  <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>



  <link rel="stylesheet" href="">   

  <link rel="stylesheet" href="">


    html, body { height: 100%; width: 100%; margin: 0; padding: 0; }






  <script src=""></script>


    var map;


      "esri/map", "esri/dijit/BasemapGallery", "esri/arcgis/utils",



      "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dijit/TitlePane",


    ], function(

      Map, BasemapGallery, arcgisUtils,


    ) {



      map = new Map("map", {

        basemap: "topo",

        center: [-105.255, 40.022],

        zoom: 13



      //add the basemap gallery, in this case we'll display maps from including bing maps

      var basemapGallery = new BasemapGallery({

        showArcGISBasemaps: true,

        map: map

      }, "basemapGallery");



      basemapGallery.on("error", function(msg) {

        console.log("basemap gallery error:  ", msg);






<body class="claro">

  <div data-dojo-type="dijit/layout/BorderContainer"

       data-dojo-props="design:'headline', gutters:false"



    <div id="map"





      <div style="position:absolute; right:20px; top:10px; z-Index:999;">

        <div data-dojo-type="dijit/TitlePane"

             data-dojo-props="title:'Switch Basemap', closable:false, open:false">

          <div data-dojo-type="dijit/layout/ContentPane" style="width:380px; height:280px; overflow:auto;">

            <div id="basemapGallery"></div>











Also,as you can see in my code i have a legend, scalebar, and overview map that i need as well. Can anyone help with this i dont really care what the layout looks like just as long as my map shows up on top of the basmap gallery and i can change the basemap and yet have my data stay put.