Hi, Kelly. I'm having trouble with how to structure the syntax to query the items and populate the carousel with the map thumbnails. Can you help me along? Am I missing something?
<script type = "text/javascript">
require([
"esri/core/urlUtils",
"esri/portal/Portal",
"esri/portal/PortalGroup",
"esri/identity/OAuthInfo",
"esri/identity/IdentityManager",
"esri/portal/PortalQueryParams"
], function (urlUtils, Portal, PortalGroup, OAuthInfo, esriId, PortalQueryParams) {
urlUtils.addProxyRule({
urlPrefix: "https://www.arcgis.com",
proxyUrl: "https://localhost/dotnet/proxy.ashx"
});
displayItems();
function displayItems() {
var portalGroup = new PortalGroup({
id: "3Ab1689d3d9dab474caa8a9cb4785a244f",
owner: "Rocket350",
portalUrl: "https://rocket350.maps.arcgis.com"
});
// Query the group items from portalGroup above
portalGroup.queryItems().then(populateCarousel);
}
function populateCarousel(items) {
//var htmlFragment = "";
index = 0;
items.results.forEach(function (item) {
index += 1;
if (item.type == "Web Map") {
console.log(item.type);
console.log(item.thumbnailUrl);
//Sconsole.log(item.thumbnailUrl);
// htmlFragment +=
// '<div class="esri-item-container">' +
// (item.thumbnailUrl
// ? '<div class="esri-image" style="background-image:url(' +
// item.thumbnailUrl +
// ');"></div>'
// : '<div class="esri-image esri-null-image">Thumbnail not available</div>') +
// (item.title
// ? '<div class="esri-title">' + (item.title || "") + "</div>"
// : '<div class="esri-title esri-null-title">Title not available</div>') +
// "</div>";
$('<div class="carousel-item"><img src="'+ item.thumbnailUrl+'" width="50%"></div>').appendTo('.carousel-inner')
console.log(index);
}
else {
console.log(item.type);
}
});
$('.carousel-item').first().addClass('active');
$('.carousel-indicators > li').first().addClass('active');
$('#mapCarousel').carousel();
}
});
</script>