Use this discussion thread to ask questions that you would like answered during the AppStudio Workshop 2020. Use the "Add a Reply" button below to ask your question and we will either answer the question in this thread of discuss it at our next workshop session.
John,
I think this will help you understand the concept of displayScaleFactor in QML, https://community.esri.com/thread/197716-how-to-use-the-displayscalefactor
Thank you,
Erwin
I was also able to add a logo to the header Toolbar and ColumnLayout on the GalleryPage and MapPage. They just appear a bit small.
This was the code I used. Any suggestions as to a better way of doing so or how to increase image size?
Thanks.
ColumnLayout {
id: toolBarColumn
width: parent.width
spacing: 0
Item {
Layout.fillWidth: true
Layout.preferredHeight: headerRow.height
RowLayout {
id: headerRow
height: app.headerHeight
Controls.Icon {
imageSource: "../images/mtpa2.png"
Layout.leftMargin: app.widthOffset
Layout.alignment: Qt.AlignVCenter
}
Oh gawd. I found the problem.... my extent is off. I'm gonna leave this here instead of deleting it. I deserve the shame.
Hi,
I've got a vector tile package that I'm trying to load into a MapView. The map control is definitely added to the page (building off Tuesday's lab), but I can't get the .vtpk to draw. Seems like something silly that I'm missing. I'm sure the vector tile package is valid (draws fine in pro, I've published it as a hosted service) and the initial viewpoint should be just within the data area. Appreciate any pointers.
Here is the code snipped I'm working with:
MapView <SPAN class="punctuation token">{</SPAN> id<SPAN class="punctuation token">:</SPAN> mapView anchors<SPAN class="punctuation token">.</SPAN>fill<SPAN class="punctuation token">:</SPAN> parent Map <SPAN class="punctuation token">{</SPAN> id<SPAN class="punctuation token">:</SPAN> map Basemap <SPAN class="punctuation token">{</SPAN> ArcGISVectorTiledLayer <SPAN class="punctuation token">{</SPAN> id<SPAN class="punctuation token">:</SPAN> vectorbasemap url<SPAN class="punctuation token">:</SPAN> AppFramework<SPAN class="punctuation token">.</SPAN>userHomePath <SPAN class="operator token">+</SPAN> <SPAN class="string token">"/ArcGIS/Runtime/Data/Basemap_Color_Complete_Vector.vtpk"</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN> initialViewpoint<SPAN class="punctuation token">:</SPAN> ViewpointCenter <SPAN class="punctuation token">{</SPAN> id<SPAN class="punctuation token">:</SPAN> initialViewpoint center<SPAN class="punctuation token">:</SPAN> Point <SPAN class="punctuation token">{</SPAN> x<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">13647642.0</SPAN> y<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">5703059.0</SPAN> spatialReference<SPAN class="punctuation token">:</SPAN> SpatialReference <SPAN class="punctuation token">{</SPAN>wkid<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">3857</SPAN><SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN> targetScale<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">72224.0</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
which results in this:
The data location should be fine, I think:
This is what the same tile package looks like in pro:
Thanks for the workshop, it's been great and helping to give me the push I needed. AppStudio, AppStudio Player and Qt/QML are (for some reason) more attractive to me than Xamarin... and that's coming from a .NET developer.
Just to add to with my first question above regarding the difficulty of closing the MapViewer app on a Windows device, it seems to be intermittent. I am running the app on a computer with dual monitors and sometimes the app opens fullscreen without the thin white strip at the top, which does have the option to close the app, other times this strip/header is not present so it it more difficult to close using conventional ways.
I will see if I can reproduce it more reliably.
Dear ApddStudio Team
After configuring some of my webmaps to show in the MapViewer template, I created the executables for Android and Windows 10 desktop. I then installed them on the respective devices.
I have two questions.
1) When the MapViewer loads in Windows, there does not seem to be a menu option to close the application. Am I missing something? On Android it is easy to just click on teh back button to exit the application.
2) Is it possible to load a static image, like a logo, to the webmap header page? If so, would it be on the Panel.qml or MenuPage.qml control pages? Could you please provide a bit more detail if it is possible?
Thank you
Dear Mallemala Kishore
I would also really like the webmap popups to be honoured in my MapViewer app. You seem to have modified the code to get it to work.
Can you please provide a bit more details as to where in the PanelPage.qml you made these changes?
Did you also need to make changes to the IdentifyFeaturesView.qml?
Thanks Tina, that answers my questions! Looking forward to the 2 half this week.
Hi Course Organizers
Please can you explain the usage of scaleFactor in the Style documentation. Applying the rules distort my widgets. I am not following the rules correctly.
AppStudio sample style guide · Esri/developer-support Wiki · GitHub
import ArcGIS.AppFramework 1.0 property double scaleFactor: AppFramework.displayScaleFactor
Regards
John
Thank you Tina for your guidance.
The following code change in panelPage.qml was able to display the popup from webmap.
<SPAN class="comment token">//featuresView.layerName = popupManager.objectName</SPAN> featuresView<SPAN class="punctuation token">.</SPAN>layerName <SPAN class="operator token">=</SPAN> popupManager<SPAN class="punctuation token">.</SPAN>popup<SPAN class="punctuation token">.</SPAN>title <SPAN class="keyword token">var</SPAN> popupwebfields <SPAN class="operator token">=</SPAN> popupManager<SPAN class="punctuation token">.</SPAN>popup<SPAN class="punctuation token">.</SPAN>popupDefinition<SPAN class="punctuation token">.</SPAN>fields <SPAN class="keyword token">var</SPAN> popupModel <SPAN class="operator token">=</SPAN> popupManager<SPAN class="punctuation token">.</SPAN>displayedFields <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>popupModel<SPAN class="punctuation token">.</SPAN>count<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">var</SPAN> feature1 <SPAN class="operator token">=</SPAN> mapView<SPAN class="punctuation token">.</SPAN>identifyProperties<SPAN class="punctuation token">.</SPAN>features<SPAN class="punctuation token">[</SPAN>currentPageNumber<SPAN class="number token">-1</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="keyword token">var</SPAN> attributeJson1 <SPAN class="operator token">=</SPAN> feature1<SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">.</SPAN>attributesJson attrListModel<SPAN class="punctuation token">.</SPAN><SPAN class="token function">clear</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">for</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">var</SPAN> key <SPAN class="keyword token">in</SPAN> attributeJson1<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="comment token">// if(attributeJson1.hasOwnProperty(key))</SPAN> <SPAN class="comment token">// {</SPAN> <SPAN class="comment token">// attrListModel.append({</SPAN> <SPAN class="comment token">// "label": key,</SPAN> <SPAN class="comment token">// "fieldValue": attributeJson1[key]!== null?attributeJson1[key].toString():null</SPAN> <SPAN class="comment token">// })</SPAN> <SPAN class="comment token">// }</SPAN> <SPAN class="keyword token">for</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">var</SPAN> cnt <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">;</SPAN> cnt <SPAN class="operator token"><</SPAN> popupwebfields<SPAN class="punctuation token">.</SPAN>length<SPAN class="punctuation token">;</SPAN> cnt<SPAN class="operator token">++</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">var</SPAN> key1 <SPAN class="operator token">=</SPAN> popupwebfields<SPAN class="punctuation token">[</SPAN>cnt<SPAN class="punctuation token">]</SPAN> <SPAN class="keyword token">if</SPAN><SPAN class="punctuation token">(</SPAN>key1<SPAN class="punctuation token">.</SPAN>visible <SPAN class="operator token">===</SPAN> <SPAN class="keyword token">true</SPAN> <SPAN class="operator token">&&</SPAN> key1<SPAN class="punctuation token">.</SPAN>fieldName <SPAN class="operator token">===</SPAN> key<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> attrListModel<SPAN class="punctuation token">.</SPAN><SPAN class="token function">append</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN> <SPAN class="string token">"label"</SPAN><SPAN class="punctuation token">:</SPAN> key1<SPAN class="punctuation token">.</SPAN>label<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"fieldValue"</SPAN><SPAN class="punctuation token">:</SPAN> attributeJson1<SPAN class="punctuation token">[</SPAN>key<SPAN class="punctuation token">]</SPAN><SPAN class="operator token">!==</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="operator token">?</SPAN>attributeJson1<SPAN class="punctuation token">[</SPAN>key<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">toString</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN><SPAN class="keyword token">null</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">break</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">return</SPAN> attrListModel <SPAN class="comment token">//return popupManager.displayedFields</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Thank you for asking your question in our GeoNet group.
1) You can set the search in the web map item > Settings page > scroll down to Application Settings section
2) That is correct, currently, Map Viewer is not honoring the custom popup and this is a known ArcGIS Runtime limitation. You can create an Esri support case if you wish to use the custom pop-up.
Thanks,
Tina
Dear Team,
I am using Map Viewer template and configured the web map item id. Application loading the web map directly and all tools are working fine, except Search and Popup.
1. Search: My search is pointing to default portal search. What is the procedure to change this search with in the web map layers?
2. Popup: I have custom popup configured on the web map. the application is not honoring the custom popup. do i need to change the identify view for this?
Kindly advise.
Thank you.
Question 2- Did you look into this link which in the blog I linked above? Without that you cannot get offline areas in AppStudio Map Viewer template. If you more questions on that please post your question with the ArcGIS Online.
Question 1- Yes you set the visibility of layers dynamically as soon as the web map loads in the template application. But that requires you to write some code. The templates allows users/authors to customize it as per their needs. Currently, in Map Viewer there is layer list and you can turn on or off layer visibility manually though. If you are interested I can look for a sample or code snippet how to dynamically turn off layers.
Nakul
Hi Nakul,
Thank you for the answers,
In question #2, I have tried the second option mentioned in your answer, but I cannot get the offline option in the settings of my web map (figure below). Just for clarity, I created my web map by directly adding the layers in Map Viewer and then launched it, I am not sure if there is an error in my web map.
regarding question #1, I mean the layers within a single web map. I have flood hazard area layers for different return periods and I want that it shows me one layer initially and based on the need the rest of layers will be enabled by users.
Sefat
Hello,
I have a new question. Is it possible to add the Web Map map Identify sample code in this item: https://github.com/Esri/arcgis-appstudio-samples/tree/v4.2/Web%20Map, to the Quickreport template?
The goal is to add web map functionality - in particular "Identify", a user clicks on a map feature (polygon) and get a popup with info from the attribute tables - to the quickreport. e.g. at the end of the report functionality, after the Add Details + Submit is executed, there is one more step where one can see the web map and click on it to get a popup.
If there is a tutorial or example of combining 2 other samples using Qt creator, or an overview of how this is done using Qt Creator, that would be greatly appreciated. I searched and found similar questions posted but could not find any examples. I'm assuming that this would require integrating code.
Thank you, Jen
Are you able to access this https://github.com/Esri/arcgis-appstudio-samples ? And then look for the Analyze ViewShed sample.
Perfect, thanks so much for this info and fast reply. But can you please check the URL to the "sample app"?
Thank you! Jen
Hi Jen,
Thanks for attending the workshop. We hope to see you again.
Yes, ArcGIS Pro can be used to publish the GP service. ArcGIS Pro aka ArcGIS Desktop can be use to create, publish and consume a GP service and it works only on windows. However, once published the service can be consumed in the AppStudio+ ArcGIS Runtime app which can run on multiple platforms (iOS, Android, Windows, MacOS, Linux). Again AppStudio cannot be used to create a GP service. Only can be used to consume it in a client native application. We have a sample app available on how to consume a GP service created from a ArcGIS Pro in a AppStudio application using ArcGIS Runtime.
Please let me know if this helps.
Hi Bill,
We are glad to see you at the workshop.
1) Do you mean how to get the item/group ID for the Map Viewer template and feature service URL for the Quick Report template?
To obtain the web map item ID for the Map Viewer template, you will need to go to AGOL. choose any web map, you can found the item ID in the URL. See the screenshot below.
To obtain the group ID, go to AGOL and choose any group, you can found the group ID in the URL as well. See the screenshot below.
To obtain the feature service URL for the quick report template, go to AGOL and choose a feature layer > navigate to the bottom URL section and copy the URL. See the screenshot below.
2) Thank you for bringing us attention on this. The color picking control in macOS is slightly different and we will modify the exercise instructions.
However, you can open a hex code color from the web browser, and use the eyedropper tool to pick the color. See the screenshot below.
Please let us know if you have any questions and we are looking forward to seeing you on Thursday.
Hi Karimullah,
I am glad you enjoyed the workshop!
Let me answer your question 2 first
2- WebMaps only work in the online mode. If you are interested in loading offline maps. You have two options.
First one is configure and consume Mobile Map packages (MMPK). You can learn more about it here
Second option is to prepare your WebMaps ready with preplanned workflow. Please check out the section -support for the offline map areas
1. Are you referring to different web maps cards (as shown in the image below) ? or the layers within a single web map?
Hi Ari Lukas,
I am glad that you enjoyed the workshop. To answer your question, the AppStudio install does not include a font library. You will need to obtain your own font files. Please make sure you have the license to use the font.
Hi Chris, et al...
Thanks for a great start to this workshop and thanks for making the recording available so quickly. I have a couple questions...
1) Perhaps this will be covered in session 2 or later but I'm curious how the codes for the Map query text box in the Gallery properties (Map Viewer exercise), the WebMap ID and Item ID (Quick Report exercise) are obtained? I checked in my AGOL account and was not able to find such codes in existing web maps or groups.
2) I am working on a Mac and noticed that the option to manually enter a hex value code for the Background color in the Resources section (step 3) of the Map Viewer exercise was not available in the color window.
Thanks again...looking forward to the rest of the sessions....regards.
Thanks for a great first day, I cannot wait to see what the next few days have in store.
I have a quick question. I believe you may have already touched on this but in exercise 3 it tells you to change the font. Is there a font library that comes with the AppStudio install or would I need to access fonts that I have installed on my cpu to make those changes?
Thanks for all of your hard work,
Ari Lukas
Thank you for the great workshop! I have two questions may be simple but I don't know how to fix it. questions are:
1. Using the Mapviewer template, when we have multiple layers of data and when I launch the app in a device it shows all the layers initially but I want it to show only one layer when the app is opened. is there any way for this in the template?
2. I have used a web map in the Map viewer template. when my mobile device is offline the map is not shown, so is there any settings for this to show my map offline too.
Thank you so much,
Karimullah Sefat
Thanks for a great first day of class! I have what I hope is a quick question, perhaps it will be covered later. Here https://developers.arcgis.com/qt/latest/qml/guide/geoprocessing.htm I see this: “As an ArcGIS Desktop user, you can share a geoprocessing package or publish a web service to enable an ArcGIS Runtime SDK app to consume a geoprocessing task.”
…but can we use ArcGIS Pro instead to publish a geoprocessing web service that can be consumed as a geoprocessing task…? I assume it is yes…. https://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing/share-analysis/what-is-a-geoprocessing-service.htm ... it would not make much sense for AppStudio to still reply only on Desktop given Esri’s desire to move all things to Pro, right?
Thanks so much! Jen
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.