MapViewer Template Map Page Questions

1201
15
07-19-2020 04:39 PM
GarrettSmith1
New Contributor III

Hello

My previous question had to do with QuickReport template, but I am trying to combine the functionality of the two and am working simultaneously on both to get them to where they are actually ready to be combined.

I plan to use the MapPage from MapViewer as my landing page in the QuickReport template and have almost got it to function in the way that I am intending for the app that I am creating. I have run into two issues.

First, is there a way to remove the measure tool from the header bar? I have placed visible:false under the ControlIcon for the measure tool icon, however it does not disappear. When I remove code for the measure tool within the page I run into two issues; (1) the legend for the feature within the map stops working and/or (2) the MapPage opens on the measure page and no other buttons work.

Second, is there a way to declare what attributes I want to appear in the legend window when a feature is selected? I only want three things to appear. If so, is there also a way to order them?

Thank you.

0 Kudos
15 Replies
TinaJin
Esri Regular Contributor

Hi Garrett Smith,

Thank you so much for asking questions in our GeoNet Community. To hide the measure tool, you will need to

1) Set the measureToolIcon visible property to false in the views > MapPage.qml file. 

2) In the same MapPage.qml file, navigate to the function updateMenuItemsContent ( ) around line 831. Comment measureToolIcon.visible = true around line 854 and 874. 

I hope it helps.

Thanks,

Tina 

0 Kudos
GarrettSmith1
New Contributor III

Hello Tina

Thank you so much. That definitely got rid of the measure tool button and the map page functions as I would expect it to now.

Did you get a chance to look at the question regarding the attributes that show in the legend? Right now I have a feature layer that has about 15 attributes and I only want to show three of them. Should I get rid of some of these attributes in ArcGIS Online or within ArcMap and reload them into ArcGIS Online? They would have no meaning to the general public who will be using this app if I ever get it finished.

Again, thank you so much and have a great day,

Garrett

0 Kudos
TinaJin
Esri Regular Contributor

Hi Garrett,

I am glad to help.

The easiest way will be to create custom pop-up and hide attributes in ArcGIS Online or Enterprise for your web map. By doing this you don't have to edit any code because the Map Viewer template will take care of it.

I am not sure which version of AppStudio Desktop you are using. I recommend you download the latest AppStudio 4.3 Desktop (beta) from our Early Adopter Community. Then you can download Map Viewer 4.3 beta and it supports custom pop-up. 

Thanks,

Tina 

0 Kudos
GarrettSmith1
New Contributor III

Hi.

I have not downloaded the most recent Beta version. If I download it will I loose the work that I have done on the two templates that I am working with? I know that you guys could fly through what I have done thus far, but I have about a week or two worth of work on these templates and would hate to loose my momentum. Not that I am complaining, this is one of the most challenging projects that I have worked on and most of that time is just getting used to the coding and architecture of the templates themselves and constantly deleting, adding, and subsequently testing everything that I do. If the error dialog does not pop up when I run the app it is rewarding. 

Maybe the best route is to use ArcGIS Online to hide the attributes, that is not hard for me to do and like I said most are internal designations and would have no meaning for the general public.

Thanks again and more questions will be coming I am sure. 

Garrett

0 Kudos
GarrettSmith1
New Contributor III

Hi

Sorry.

I tried to reconfigure the popup and I am still getting the full list of attributes in the legend. See attached screenshot. I should note that I am loading the web map directly into the MapPage using the portalUrl and itemID commands (if that is what they are called), I am not sure if that is why it is not working?

Thanks again

Garrett

MapViewer

0 Kudos
TinaJin
Esri Regular Contributor

Hi Garrett,

I understand the frustration.

I have double-checked this feature, it is only supported in Map Viewer 4.3 beta.  There are two options, we can bring your customization code to 4.3 beta template or bring the code for this feature into your existing customized template app.

Here are three files you will need to make changes for this feature.

1) MapViewerApp.qml file in the MapViewer folder.

2) PanelPage.qml and MapPage.qml files in the Map Viewer > views folder. 

I have attached these three qml files with the code changes for this feature.  If you didn't customize code in these files you can directly replace them. If you did, I have added the comment in MapViewerApp.qml file and MapPage.qml file to note the code changes (see screenshot below).

I hope this will help you.

Thanks,

Tina

0 Kudos
GarrettSmith1
New Contributor III

Hi Tina

Thanks so much for this.

Stupid beginner question. What should go in between the brackets {  ...} under each of the functions?

Thanks

Garrett

0 Kudos
TinaJin
Esri Regular Contributor

Hi Garrett,

If you download the zip file and open QML files, you can expand and see the functions inside the brackets.

Thanks,

Tina 

0 Kudos
GarrettSmith1
New Contributor III

Hi

Sorry again. Where is the .zip file located?

Thanks again


Garrett

0 Kudos