When I configure the Basemap Gallery Widget in the Web AppBuilder for ArcGIS, the basemaps are not available in the Web App Viewers. I have tried this in current versions of IE10, Chrome and Safari (iOS).
I have a basemap gallery group that I have configured in our Organization, if that matters.
Is anyone else having problems making the basemaps appear for the web app viewer?
Solved! Go to Solution.
Stan,
Thank you for your time. A little more may be required. Maybe a link to a help topic?
I got to your number one instruction and got this as a result:
{"error": { "code": 403, "messageCode": "GWM_0003", "message": "You do not have permissions to access this resource or perform this operation.", "details": [] }}
I know little about the Development side of AGOL, but I can learn if I have to. Does the application have to be registered? I cannot make the app public.
--Adam
Yes the Web Map needs to be made public if only for a few moments so you can get the json parameters. I do not believe the application has to be registered.
I suppose if you really wanted to you could either create a public web map that has everything you want with out the private stuff. Then do step one and manually add the json that you need or just write your own json file from scratch. That way you wold not have to make it public at all. By using the url method it just makes it easier.
Stan!
Thank you so much for hanging in there with me. I appreciate your patience. You fixed it!
--Adam
I am having the same problem. Following the steps above, still the same problem...grrrr. What am I doing wrong? This is using the DEV WAB 1.1 on Portal 10.3. Below is my config_Basemap Gallery.json
{ "basemapGallery": { "basemaps": [ { "title": "EMAG2: Earth Magnetic Anomaly 2 arc-minute Grid", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/6ba6b870aa234ea4a6cfce0fd742fd1f/info/thumbnail/EarthMag.JPG", "layers": [ { "id": "emag2_6357", "opacity": 1, "visibility": true, "url": "http://maps.ngdc.noaa.gov/rest/services/web_mercator/emag2/MapServer" } ], "spatialReference": { "wkid": 102100, "latestWkid": 3857 } }, { "title": "Global Relief Model (GEBCO08): Shaded-Relief Visualization", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/d4150aed7be24f5fbee551f4a634330c/info/thumbnail/GlobalRelief.JPG", "layers": [ { "id": "gebco08_hillshade_3591", "opacity": 1, "visibility": true, "url": "http://maps.ngdc.noaa.gov/rest/services/web_mercator/gebco08_hillshade/MapServer" } ], "spatialReference": { "wkid": 102100, "latestWkid": 3857 } }, { "title": "Imagery", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/d0135822507947b2a3809af36f2d91e6/info/thumbnail/tempimagery.jpg", "layers": [ { "id": "World_Imagery_2017", "visibility": true, "opacity": 1, "url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" } ], "spatialReference": { "wkid": "102100" } }, { "title": "Imagery with Labels", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/30699b07b44f47ef929b9e216594a7db/info/thumbnail/tempimagery_with_labels_ne_usa.png", "layers": [ { "id": "World_Imagery_6611", "opacity": 1, "visibility": true, "url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" }, { "id": "World_Boundaries_and_Places_1145", "isReference": true, "opacity": 1, "visibility": true, "url": "http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServe..." } ], "spatialReference": { "wkid": "102100" } }, { "title": "Light Gray Canvas", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/a9bfcd532c964b96ba617a0874423805/info/thumbnail/templight_gray_canvas_with_labels__ne_usa.png", "layers": [ { "id": "World_Light_Gray_Base_1486", "opacity": 1, "visibility": true, "url": "http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer" }, { "id": "World_Light_Gray_Reference_8656", "isReference": true, "opacity": 1, "visibility": true, "url": "http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer" } ], "spatialReference": { "wkid": "102100" } }, { "title": "Mapbox Imagery", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/62f8b8ab556d474ba1070b3e1f68f593/info/thumbnail/mapboxsatellite.jpg", "layers": [ { "templateUrl": "http://{subDomain}.tiles.mapbox.com/v3/nps.map-n9nxe12m/{level}/{col}/{row}.png", "id": "WebTiled_1759", "type": "WebTiledLayer", "title": "Mapbox Imagery", "copyright": "Attribution for MapBox tilesets: Data © OpenStreetMap contributors. Design © MapBox.", "fullExtent": { "xmin": -20037508.342787, "ymin": -20037508.34278, "xmax": 20037508.34278, "ymax": 20037508.342787, "spatialReference": { "wkid": 102100 } }, "subDomains": [ "a", "b", "c", "d" ], "visibility": true, "opacity": 1 } ], "spatialReference": { "wkid": "102100" } }, { "title": "Mapbox Streets", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/aaa3011aa2db437e9e628f5dfb6cf9fc/info/thumbnail/mapboxstreets.png", "layers": [ { "templateUrl": "http://{subDomain}.tiles.mapbox.com/v3/nps.map-06dnxzq5/{level}/{col}/{row}.png", "id": "WebTiled_5498", "type": "WebTiledLayer", "title": "Mapbox Streets", "copyright": "Data © OpenStreetMap contributors. Design © MapBox.", "fullExtent": { "xmin": -20037508.342787, "ymin": -20037508.34278, "xmax": 20037508.34278, "ymax": 20037508.342787, "spatialReference": { "wkid": 102100 } }, "subDomains": [ "a", "b", "c", "d" ], "visibility": true, "opacity": 1 } ], "spatialReference": { "wkid": "102100" } }, { "title": "Mapbox Terrain", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/35eda76fd474469c9fa4ad2b8373501c/info/thumbnail/mt.png", "layers": [ { "templateUrl": "http://a.tiles.mapbox.com/v4/nps.map-lj6szvbq/{level}/{col}/{row}.png?access_token=pk.eyJ1IjoibnBzIiwiYSI6IkdfeS1OY1UifQ.K8Qn5ojTw4RV1GwBlsci-Q", "id": "WebTiled_2116", "type": "WebTiledLayer", "layerType": "WebTiledLayer", "title": "Mapbox Terrain", "copyright": "Mapbox", "fullExtent": { "xmin": -20037508.342787, "ymin": -20037508.34278, "xmax": 20037508.34278, "ymax": 20037508.342787, "spatialReference": { "wkid": 102100 } }, "visibility": true, "opacity": 1 } ], "spatialReference": { "wkid": 102100 } }, { "title": "National Geographic", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/7634c349af5c4ca6ac70078db97d80fd/info/thumbnail/natgeo.jpg", "layers": [ { "id": "NatGeo_World_Map_2536", "opacity": 1, "visibility": true, "url": "http://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer" } ], "spatialReference": { "wkid": "102100" } }, { "title": "National Park Service - Park Tiles", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/b179f0c04598427c8e4cc722bbae3bde/info/thumbnail/parktile.png", "layers": [ { "templateUrl": "http://{subDomain}.tiles.mapbox.com/v3/nps.2yxv8n84/{level}/{col}/{row}.png", "id": "WebTiled_9723", "type": "WebTiledLayer", "title": "Park Tiles", "copyright": "National Park Service", "fullExtent": { "xmin": -20037508.342787, "ymin": -20037508.34278, "xmax": 20037508.34278, "ymax": 20037508.342787, "spatialReference": { "wkid": 102100 } }, "subDomains": [ "a", "b", "c", "d" ], "visibility": true, "opacity": 1 } ], "spatialReference": { "wkid": "102100" } }, {}, { "title": "Oceans", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/b548883bdf3e482d8e28e2b8717a3d84/info/thumbnail/tempoceans.jpg", "layers": [ { "id": "Ocean_Basemap_2089", "opacity": 1, "visibility": true, "url": "http://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer" }, { "url": "http://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer", "id": "World_Ocean_Reference_1261", "isReference": true, "visibility": true, "opacity": 1 } ], "spatialReference": { "wkid": "102100" } }, { "title": "OpenStreetMap", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/cb4f9f9b2242489c883a48ac7320b51b/info/thumbnail/temposm.jpg", "layers": [ { "visibility": true, "opacity": 1, "type": "OpenStreetMap" } ], "spatialReference": { "wkid": "102100" } }, { "title": "Stamen Toner Basemap", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/5c1ae6c59cee4f1f87c8f58032fe1a1f/info/thumbnail/stamen_toner.png", "layers": [ { "templateUrl": "http://{subDomain}.tile.stamen.com/toner/{level}/{col}/{row}.png", "id": "WebTiled_3843", "type": "WebTiledLayer", "title": "Stamen Toner Basemap", "copyright": "Stamen", "fullExtent": { "xmin": -20037508.342787, "ymin": -20037508.34278, "xmax": 20037508.34278, "ymax": 20037508.342787, "spatialReference": { "wkid": 102100 } }, "subDomains": [ "a", "b", "c", "d" ], "visibility": true, "opacity": 1 } ], "spatialReference": { "wkid": "102100" } }, { "title": "Streets", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/dbf4603731084f8bb2d1d6198c20bef4/info/thumbnail/world_street_map.jpg", "layers": [ { "id": "World_Street_Map_8421", "opacity": 1, "visibility": true, "url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" } ], "spatialReference": { "wkid": "102100" } }, { "title": "Terrain with Labels", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/dc3aa6bfb50a4609bdd396daef45998c/info/thumbnail/tempTerrain_with_labels_ne_usa.png", "layers": [ { "id": "World_Terrain_Base_3", "layerType": "ArcGISTiledMapServiceLayer", "opacity": 1, "visibility": true, "url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer" }, { "id": "World_Reference_Overlay_5790", "layerType": "ArcGISTiledMapServiceLayer", "isReference": true, "opacity": 1, "visibility": true, "url": "http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer" } ], "spatialReference": { "wkid": 102100, "latestWkid": 3857 } }, { "title": "Topographic", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/9d98f7113f9b469c8c302b210db7b922/info/thumbnail/topo_map_2.jpg", "layers": [ { "id": "defaultBasemap", "opacity": 1, "visibility": true, "url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer" } ], "spatialReference": { "wkid": "102100" } }, { "title": "USA TOPO Maps", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/14ab4838dd7649ca917c6bce07da77c4/info/thumbnail/TOPO.png", "layers": [ { "id": "USA_Topo_Maps_6503", "opacity": 1, "visibility": true, "url": "http://services.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer" } ], "spatialReference": { "wkid": 102100, "latestWkid": 3857 } }, { "title": "USGS Aerial Imagery (Tiled)", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/b7d6386faf90486c9437167730fe0fb8/info/thumbnail/ago_downloaded__281_29.png", "layers": [ { "id": "USGSImageryOnly_5376", "opacity": 1, "visibility": true, "url": "http://basemap.nationalmap.gov/ArcGIS/rest/services/USGSImageryOnly/MapServer" } ], "spatialReference": { "wkid": 102100, "latestWkid": 3857 } }, {}, { "title": "USGS Shaded Relief (Tiled)", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/3efaff324fe04e359815f029ac9ac20d/info/thumbnail/ShadedRelief.JPG", "layers": [ { "id": "USGSShadedReliefOnly_552", "opacity": 1, "visibility": true, "url": "http://basemap.nationalmap.gov/ArcGIS/rest/services/USGSShadedReliefOnly/MapServer" } ], "spatialReference": { "wkid": 102100, "latestWkid": 3857 } }, { "title": "USGS Topo (Small Scale; Tiled)", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/2c58a74ab8f04692be59e47c88747255/info/thumbnail/12100vs1224.jpg", "layers": [ { "id": "USGSTopo_7758", "opacity": 1, "visibility": true, "url": "http://basemap.nationalmap.gov/ArcGIS/rest/services/USGSTopo/MapServer" } ], "spatialReference": { "wkid": 102100, "latestWkid": 3857 } }, { "title": "World Navigation Charts", "thumbnailUrl": "//my.org.domain/arcgis/sharing/rest/content/items/912dd7612572473089e8fe60b43f38b8/info/thumbnail/NativeClient014.jpg", "layers": [ { "id": "World_Navigation_Charts_6914", "opacity": 1, "visibility": true, "url": "http://services.arcgisonline.com/ArcGIS/rest/services/Specialty/World_Navigation_Charts/MapServer" } ], "spatialReference": { "wkid": 102100, "latestWkid": 3857 } }, { "title": "Test", "thumbnailUrl": "${appPath}/configs/BasemapGallery/thumbnailUrl.png", "layers": [ { "url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" } ], "spatialReference": { "wkid": 102100 } } ] } }
Thomas,
Taking a quick look at your file it looks like lines 237 and 394 have empty brackets that need to be removed.
Amazing. That worked! What makes me grrrr...is this is the json that "came out of the box" when I pulled the config, which is pulling the basemaps defined by the portal admin globally.
I may have spoke too soon: the basemap gallery loads, and I can switch between all basemaps EXCEPT for web tiled, such as:
{ "layers": [ { "templateUrl": "http://{subDomain}.tiles.mapbox.com/v3/nps.map-n9nxe12m/{level}/{col}/{row}.png", "id": "WebTiled_1759", "type": "WebTiledLayer", "title": "Mapbox Imagery", "copyright": "Attribution for MapBox tilesets: Data © OpenStreetMap contributors. Design © MapBox.", "fullExtent": { "xmin": -20037508.342787, "ymin": -20037508.34278, "xmax": 20037508.34278, "ymax": 20037508.342787, "spatialReference": { "wkid": 102100 } }, "subDomains": [ "a", "b", "c", "d" ], "visibility": true, "opacity": 1 } ], "title": "Mapbox Imagery", "thumbnailUrl": "//gisportal.nps.gov/arcgis/sharing/rest/content/items/62f8b8ab556d474ba1070b3e1f68f593/info/thumbnail/mapboxsatellite.jpg", "spatialReference": { "wkid": "102100" } }
which when loaded returns this error:
Uncaught TypeError: Cannot read property 'substring' of undefinedWebTiledLayer.js:8 b.constructorinit.js:108 (anonymous function)BasemapGallery.js:80 (anonymous function)init.js:229 g.forEachBasemapGallery.js:78 g._switchBasemapLayersBasemapGallery.js:77 g._getServiceInfosBasemapGallery.js:75 g._selectBasemapGallery.js:65 g.selectBasemapGallery.js:74 g._onNodeClickinit.js:176 (anonymous function)
Which leads to this library:
define("esri/layers/WebTiledLayer","dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/url dojo/has dojo/string ../kernel ../urlUtils ../SpatialReference ../geometry/Extent ./TiledMapServiceLayer ./TileInfo".split(" "),function(b,m,g,n,p,k,q,r,h,l,s,t){b=b(s,{declaredClass:"esri.layers.WebTiledLayer",constructor:function(d,a){a||(a={});this.urlTemplate=d;var f=new l(-2.0037508342787E7,-2.003750834278E7,2.003750834278E7,2.0037508342787E7,new h({wkid:102100})),e=new l(-2.0037508342787E7, -2.003750834278E7,2.003750834278E7,2.0037508342787E7,new h({wkid:102100}));this.initialExtent=a.initialExtent||f;this.fullExtent=a.fullExtent||e;this.tileInfo=a.tileInfo?a.tileInfo:new t({rows:256,cols:256,origin:{x:-2.0037508342787E7,y:2.0037508342787E7},spatialReference:{wkid:102100},lods:[{level:0,resolution:156543.033928,scale:5.91657527591555E8},{level:1,resolution:78271.5169639999,scale:2.95828763795777E8},{level:2,resolution:39135.7584820001,scale:1.47914381897889E8},{level:3,resolution:19567.8792409999, scale:7.3957190948944E7},{level:4,resolution:9783.93962049996,scale:3.6978595474472E7},{level:5,resolution:4891.96981024998,scale:1.8489297737236E7},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.99245256249,scale:4622324.434309},{level:8,resolution:611.49622628138,scale:2311162.217155},{level:9,resolution:305.748113140558,scale:1155581.108577},{level:10,resolution:152.874056570411,scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144}, {level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:0.597164283559817,scale:2256.994353},{level:19,resolution:0.298582141647617,scale:1128.497176}]});this.spatialReference=new h(this.tileInfo.spatialReference.toJson()); this.copyright=a.copyright||"";var c=new n(d),f=c.scheme+"://"+c.authority+"/";this.urlPath=d.substring(f.length);this.tileServers=a.tileServers||[];-1===c.authority.indexOf("{subDomain}")&&this.tileServers.push(f);if(a.subDomains&&0<a.subDomains.length&&1<c.authority.split(".").length){this.subDomains=a.subDomains;var b;g.forEach(a.subDomains,function(a,d){-1<c.authority.indexOf("${subDomain}")?b=c.scheme+"://"+k.substitute(c.authority,{subDomain:a})+"/":-1<c.authority.indexOf("{subDomain}")&&(b= c.scheme+"://"+c.authority.replace(/\{subDomain\}/gi,a)+"/");this.tileServers.push(b)},this)}this.tileServers=g.map(this.tileServers,function(a){"/"!==a.charAt(a.length-1)&&(a+="/");return a});this._levelToLevelValue=[];g.forEach(this.tileInfo.lods,function(a){this._levelToLevelValue[a.level]=a.levelValue||a.level},this);this.loaded=!0;this.onLoad(this)},getTileUrl:function(d,a,b){d=this._levelToLevelValue;var e=this.tileServers[a%this.tileServers.length]+k.substitute(this.urlPath,{level:d,col:b, row:a}),e=e.replace(/\{level\}/gi,d).replace(/\{row\}/gi,a).replace(/\{col\}/gi,b),e=this.addTimestampToURL(e);return r.addProxy(e)}});p("extend-esri")&&m.setObject("layers.WebTiledLayer",b,q);return b});
Again, this is out of the box, why does the ESRI basemap widget take so much elbow grease to get working?
Are you able to get these mapbox web tiled layers to work fine in the AGOL map before you bring it to WAB?
Yes, works fine in Portal (10.3) and AGOL.
I am not really sure why it is not working. Does it have the proper permissions and sharing rights in AGOL? Just a stab in the dark. If you want you can pm me the url to your tile service.