How do I populate a Bootsrap carousel with thumbnails from maps with a group on AGOL?

561
10
12-06-2019 12:56 PM
SkylerKroll
New Contributor II

I'm new to AGOL and the JS ESRI API. As the question states, I'm looking for a way to retrieve the maps from a group with thumbnails and then populate a Boostrap carousel with the thumbnails from the maps. How do i access the group from the JS API? Do I need to create an App on AGOL  with an Id and secret to access the group? Any help pointing me in the right direction would be greatly appreciated. Thanks. group items basic authentication carousel novice

10 Replies
KellyHutchins
Esri Frequent Contributor

The following sample shows how to get content from an ArcGIS Online group and display the thumbnail and title info. 

Access ArcGIS Online items using OAuthentication - 4.13 

SkylerKroll
New Contributor II

Thank you for reply! This really helped. 

PHerk
by
New Contributor II

Hi Skyler,

Did you succeed in getting the content from a Group? Do you have any sample code to get me going.

Appreciated

Thanks

0 Kudos
PHerk
by
New Contributor II

Hi Kelly,

 Your sample gives me only the maps from the "My Content" tab in ArcGIS online. I want to get the maps from a group in My Groups, I am assigned to the group but I can't figure out how I can get the results from a group.

0 Kudos
KellyHutchins
Esri Frequent Contributor

You can use the queryGroups method on the Portal class to find the group you want to display and then use the PortalGroup.queryItems method to access the group content. 

Get the group using queryGroups: 

Portal | ArcGIS API for JavaScript 4.14 

Get the items from the group using queryItems: 

PortalGroup | ArcGIS API for JavaScript 4.14 

0 Kudos
PHerk
by
New Contributor II

Hi Kelly, any samples?

Appreciated.

0 Kudos
KellyHutchins
Esri Frequent Contributor

There isn't a sample in the sdk but there is a demo app in a Developer summit presentation that uses queryGroups here: DevSummit-presentations/template.js at 0571a5195ea33f0216b05150ff305c95a50ffa03 · hgonzago/DevSummit... 

0 Kudos
PHerk
by
New Contributor II

That is from 2014, I would like to use the latest Javascript API version....

0 Kudos
KellyHutchins
Esri Frequent Contributor

Sorry I don't have a more recent sample but the idea is the same. You'll query for the group and then use the group to query for its content. 

0 Kudos