Changing Basemaps and Attribute Popups

264
1
12-19-2020 03:13 PM
GarrettRSmith
Occasional Contributor II

Hello

Does anyone have any really simple ideas about how to add a button/option to change basemaps on the QuickReport templates map page? I have tried a couple of variations I have found online but they are not what I am looking for. I only want two basemaps; topo and satellite.

Also, is there any simple examples about adding attribute popup functionality to the same map page referenced above.

I have tried to take apart the Map Viewer template, but when I try and apply the code, controls, images, etc.. to the QuickReport template it does not work. I am also really new to this realm so I probably need a little more hand holding than these templates allow for.

0 Kudos
1 Reply
ErwinSoekianto
Esri Regular Contributor

@GarrettRSmith 

 

To add a tool button in the MapView to change basemap is pretty straightforward, we have a sample in AppStudio Desktop that is based on the ArcGIS Runtime Qt Change Basemap sample, https://developers.arcgis.com/qt/latest/qml/sample-code/change-basemap/ that you can look into. 

 

I tried adding it to QuickReport/pages/RefineLocationPage.qml around line ~930 inside the toolsContainer of the MapView. I simply copied the other Rectangle Image from the other tool, change the image source and the Mouse Area onclicked event to do change basemap,  from the sample above. I only add a logic to change the basemap to BasemapOceans, I think you can add the logic between the two basemaps that you want to switch around. Please see below screenshots and attached  RefineLocationPage.qml changes that I did for this. 

 

Screen Shot 2020-12-22 at 5.04.18 PM.png

 

I hope this helpful,

Erwin

0 Kudos