How to bypass the GalleryPage in the MapViewer template?

1057
2
Jump to solution
07-04-2017 01:22 AM
KamranYusaf1
New Contributor III

Hi

I am working on the MapViewer template (Appstudio for ArcGIS 2.0), and would like to bypass the GalleryPage, so when the "Start" button is pressed, the next page to be shown should be the MapPage(with a predefined map). How can i achieve this? 

0 Kudos
1 Solution

Accepted Solutions
SathyaPrasad
Esri Contributor

Great that you are using the latest Map Viewer template. Hope you are liking the new design and updates.

So the question is: "Skip the gallery page if only one map". This is not implemented in the current version of map viewer template i.e. Gallery page is always shown. This will be a good enhancement and we will add this feature and make this a configurable parameter in the next update of Map Viewer template. For now, you can easily achieve this by adding a line of code. 

1. Open the new Map Viewer template app in the AppStudio IDE (Qt Creator) 

2. Find the file "Gallerypage.qml" 

3. Goto around line number 95 and inside the signal "onFindItemsResultChanged" after the for loop add the following line of code:

if(app.portal.findItemsResult.itemResults.count === 1) {
   galleryPage.openMap(mapList.get(0))

}

Once done your code should look like:

\

4. Done. Buy me a cup of coffee

View solution in original post

2 Replies
SathyaPrasad
Esri Contributor

Great that you are using the latest Map Viewer template. Hope you are liking the new design and updates.

So the question is: "Skip the gallery page if only one map". This is not implemented in the current version of map viewer template i.e. Gallery page is always shown. This will be a good enhancement and we will add this feature and make this a configurable parameter in the next update of Map Viewer template. For now, you can easily achieve this by adding a line of code. 

1. Open the new Map Viewer template app in the AppStudio IDE (Qt Creator) 

2. Find the file "Gallerypage.qml" 

3. Goto around line number 95 and inside the signal "onFindItemsResultChanged" after the for loop add the following line of code:

if(app.portal.findItemsResult.itemResults.count === 1) {
   galleryPage.openMap(mapList.get(0))

}

Once done your code should look like:

\

4. Done. Buy me a cup of coffee

KamranYusaf1
New Contributor III

Hi Sathya

Thanks for the workaround. I will see you at the UC, where I will get You your cup of coffee;)

0 Kudos