AppStudio TileCache path not set / PortalItem fetchData to path not set

795
4
Jump to solution
12-23-2018 06:52 AM
RodrigoPintos
New Contributor II

Im trying the AppStudio 3.2 / Esri.ArcGISRuntime 100.4 on Windows 10.

Im not being able to set the following path to a TileCache

"C:/Users/rpintos.ICA/ArcGIS/AppStudio/Data/93c17bd6406d48b584aa96970e9b0aa2/Uruguay.tpk"

After the path is set, onPathChanged is executed but the property path doesnt change.

--------------------

Something similar happens with a PortalItem object executing

fetchData("C:/Users/rpintos.ICA/ArcGIS/AppStudio/Data/93c17bd6406d48b584aa96970e9b0aa2")

I get the following error

Error in portal item: File path must be specified to fetch data.()

------------------

I also noticed that in the last framework release they solve the following bug

-BUG-000116279 Cannot create TileCache from a path on Linux when conf.xml file uses mixed case

It just says on Linux, but what happen in Windows? I haven tried it on Android and on iOS neither.

0 Kudos
1 Solution

Accepted Solutions
nakulmanocha
Esri Regular Contributor

Path changed signal works for me. Try this code

 property string dataPath: "C:/Users/<username>/ArcGIS/AppStudio/Data/"


Basemap {
                // Nest the ArcGISTiledLayer to add it as one of the Basemap's baseLayers
                ArcGISTiledLayer {
                    TileCache{
                         path: AppFramework.userHomeFolder.fileUrl(dataPath + "/SanFrancisco.tpk")
                         onPathChanged: {
                             console.log(path)
                         }
                    }

View solution in original post

4 Replies
nakulmanocha
Esri Regular Contributor

Path changed signal works for me. Try this code

 property string dataPath: "C:/Users/<username>/ArcGIS/AppStudio/Data/"


Basemap {
                // Nest the ArcGISTiledLayer to add it as one of the Basemap's baseLayers
                ArcGISTiledLayer {
                    TileCache{
                         path: AppFramework.userHomeFolder.fileUrl(dataPath + "/SanFrancisco.tpk")
                         onPathChanged: {
                             console.log(path)
                         }
                    }
RodrigoPintos
New Contributor II

Thanks! Now is working!

An other question related to the PortalItem object.
Do I have to specify the whole path with the filename and tpk extension like .../Uruguay.tpk? Because I remember using the old Qt Sdk Runtime 10.2.6 and specifying just the folder name was enough.

Thank in advance!

0 Kudos
RodrigoPintos
New Contributor II

I have just tried it and yes, you have to specify the name and extension of the file.

What I see when it starts downloading is that the progressPercentage is always 100. That seems to be wrong

0 Kudos
RodrigoPintos
New Contributor II

I attach to 

onFetchDataProgressChanged

this is the log that I get

(First log)
qml: {"objectName":"","objectType":"NetworkRequestProgress","error":null,"objects":{},"bytesReceived":"0","bytesReceivedAsInt":0,"bytesSent":"0","bytesSentAsInt":0,"estimatedFinishTime":null,"progressPercentage":0,"startTime":"2018-12-29T16:56:13.083Z","totalBytesToReceive":"0","totalBytesToReceiveAsInt":0,"totalBytesToSend":"0","totalBytesToSendAsInt":0}

(Second log)

qml: {"objectName":"","objectType":"NetworkRequestProgress","error":null,"objects":{},"bytesReceived":"83665","bytesReceivedAsInt":83665,"bytesSent":"0","bytesSentAsInt":0,"estimatedFinishTime":"2018-12-29T16:56:13.341Z","progressPercentage":100,"startTime":"2018-12-29T16:56:13.083Z","totalBytesToReceive":"0","totalBytesToReceiveAsInt":0,"totalBytesToSend":"0","totalBytesToSendAsInt":0}

......

......

(N log)

qml: {"objectName":"","objectType":"NetworkRequestProgress","error":null,"objects":{},"bytesReceived":"115543108","bytesReceivedAsInt":115543108,"bytesSent":"0","bytesSentAsInt":0,"estimatedFinishTime":"2018-12-29T16:57:27.207Z","progressPercentage":100,"startTime":"2018-12-29T16:56:13.083Z","totalBytesToReceive":"0","totalBytesToReceiveAsInt":0,"totalBytesToSend":"0","totalBytesToSendAsInt":0}

In the second one, the percentage is already 100.

0 Kudos